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

How can you check the version of sql server?

0 Answers  


how can we know that how many users are connected in perticuler server??????

2 Answers  


logshipping is Any difference 2000 and 2005?

2 Answers  


Can we check locks in database? If so, how can we do this lock check?

0 Answers  


What is the new security features added in sql server 2016? : sql server security

0 Answers  


How to write character string constants or literals in ms sql server?

0 Answers  


What is data block and how to define data block size?

0 Answers  


can you any body tell me while running BCP Out in instance in sql server 2000 is getting error. Error = [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.?

1 Answers  


what is IDE,DMV in sql server?

1 Answers   Value Labs,


There is a table1 with records (1,2,3,4,5,6) and table2 with records (4,5,6,7,8,9).write a query so as to get the result as 1,2,3,4,5,6,7,8,9

12 Answers   RBS,


Can primary key be null?

0 Answers  


What is database replicaion? What are the different types of replication you can set up in SQL Server?

5 Answers   Aptech, HCL, Perpetual, SAIC,


Categories