Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to fetch records from a One to Many relationship table.
eg: wanna get details of all orders for a specific customer.
(do not want repeatation of master table records for child
table records)

Answers were Sorted based on User's Feedback



How to fetch records from a One to Many relationship table. eg: wanna get details of all orders fo..

Answer / syeda

Need to define a relationship to the table and common column
of tables

ex : there is a table called college which contains the
college records like studid, studentname, batch & course.
And other table called student_details which contains
studid, firstName, lastName, fathersName, mothersName, DOB,
ContactNo & address.

Here we are fetching studid, batch, course & studentname
from collete table and DOB, ContactNo & address from
students_details , of all the students whose birth month is
April 1988

Syntax : select
a.studid,a.batch,a.course,a.studentname,b.DOB,b.ContactNo,b.address
from college a, student_details b where a.studid=b.studid
and b.DOB like '%-Apr-1988'

Is This Answer Correct ?    4 Yes 0 No

How to fetch records from a One to Many relationship table. eg: wanna get details of all orders fo..

Answer / jagadeesh

SubQuery

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More SQL Server Interview Questions

what is a schema in sql server 2005? : Sql server database administration

0 Answers  


Explain what are sparse columns?

0 Answers  


How to convert a unicode strings to non-unicode strings?

0 Answers  


What do you understand by a view? What does the with check option clause for a view do?

0 Answers  


Define right outer join?

0 Answers  


What is the difference between MVC and Teir Architecher? Plz explain with Layyered Programming example...? Thanks

0 Answers   TCS,


What is the usage of sign function?

0 Answers  


If you are given access to a SQL Server, how do you find if the SQL Instance is a named instance or a default instance?

0 Answers  


How to get a list of all tables with "sys.tables" view in ms sql server?

0 Answers  


What is the system function to get the current user's user id?

2 Answers   HCL,


How can we determine what objects a user-defined function depends upon?

0 Answers  


How you can find out if an index is useful to the optimizer?

0 Answers  


Categories