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

how can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role? : Sql server administration

1042


Explain what are the authentication modes in sql server?

1073


1 01 101 01010

2100


What are user defined functions in ms sql server?

1064


What is the full form of dql?

1026


Are resultset updatable?

1007


Can binary strings be used in arithmetical operations?

985


What are the different editions available in sql server 2000?

1113


What is difference between join and natural join?

1061


How to return the date part only from a sql server datetime datatype?

1165


What are the hotfixes and patches in sql server?

1065


Can you explain what is sql server english query?

1054


How to stop log file growing too big?

1062


what's the difference between delete table and truncate table commands? : Sql server database administration

1040


How to get the definition of a stored procedure back?

1020