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)

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why olap is used?

951


What does the not null constraint do?

1059


Why do you need a sql server?

1075


Can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible?

996


tell me what are the steps you will take to improve performance of a poor performing query? : Sql server database administration

1003


Why we use functions in sql server?

1050


What is log shipping?

945


What is lookup override?

1001


explain how to create a new schema in a database? : Sql server database administration

1092


difference between Clustered index and non clustered index ?

976


How many joins in sql server?

929


What are the basic features of a trigger in ms sql server?

1169


What the difference between UNION and UNIONALL?

1017


When I run the sql server 2000 setup, it just hangs. What do I do?

1062


How to use linked server?

1159