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
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 do we know if any query is retrieving a large amount of data or very little data?
query processing
How you provide security to cube? : sql server analysis services, ssas
How to skip remaining statements in a loop block using continue statements?
What is a NOLOCK?
What stored by the msdb? : sql server database administration
What is the difference between clustered and non-clustered indexes in ms sql server?
Department ----------- salary Deptname 1000 A 3000 A 2000 B 3000 B 4000 C 5000 C select the deptname where salary >=5000 result should be: Deptname --------- C please post only executed query in SQL server 2005 Asked By: Md. Niyaz
How to rebuild indexes with alter index ... Rebuild?
Can we execute a stored procedure inside a trigger?
6 Answers BirlaSoft, CarrizalSoft Technologies, United Healthcare,
Explain the steps to use transact-sql cursor?
What is difference between aggregate and analytic function?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)