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 I have to use stored procedures?

1050


What is service broker?

1005


What is sql server 2000 work load governor?

1066


What is the use of for clause?

1118


How to add a new column to an existing table with "alter table ... Add" in ms sql server?

1010


Why truncate is ddl?

1089


When a primary key constraint is included in a table, what other constraints does this imply?

989


What are the differences between char and nchar in ms sql server?

1087


What is the sql server 2000 version number?

1081


What is ddl and dml commands?

906


What is the default order of an order by clause?

997


What is the maximum row of a size?

1018


When to use null data driven subscription?

207


How can you control the amount of free space in your index pages?

1057


What is indexing in sql server with example?

1004