Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extractings fields from more than one table

Status
Not open for further replies.

Dynamo3209

Programmer
Jan 2, 2003
57
US
Hi,
I have created a job application form, the data for which is stored in three different tables
PersonalDetails tables (Master table)
Educational Background table (child table)
Employment History table (child table)

in the educational background table i have fields like School College Name, DegreeObtained etc so for one applicant there are many rows.

Now from these two tables I have to extract the applicant name from personal details tabls and his educational qualifications from the other table and display it in one row, how can this be achieved.
Appreciate any help.
Thanks,
Dynamo
 
Either with implicit or explicit joins

If the common key between two tables "A" and "B" are the columns "A_ID" and "B_ID", respectively, then:

SELECT * from A, B WHERE A_ID = B_ID

or

SELECT * from A right join B on A_ID = B_ID

Will retrieve rows across both tables.

Want the best answers? Ask the best questions: TANSTAAFL!
 
[Sorry. Hit "submit" when I meant to hit "preview"]

That last example was not right. It an inner join is equivalent to using the comma, not right join.

If you have records in A for which there may be no matching records in B, a LEFT JOIN is called for:

SELECT * from A left join B on A_ID = B_ID

Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top