Click here to Skip to main content
15,893,644 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have three tables:

1. Employee Details
2. Passport Details
3. Visa Details

i want to connect three of them .
i have appropriate forign keys set.

If i want all the fields What would be the SQL statement ?




Regards
Nakul Kundra
Posted

1 solution

SQL
SELECT * FROM EmployeeDetails ed INNER JOIN PassportDetails pd 
ON ed.PrimKey = pd.ForeignKey INNER JOIN VisaDetails vd ON
pd.PrimKey = vd.ForeignKey.


Replace the PrimKey and ForeignKey with your key name.

Please vote and Accept Answer if it Helped.
 
Share this answer
 
Comments
nakulkundra 28-Sep-10 3:12am    
Thanks Dear
Hiren solanki 28-Sep-10 3:20am    
cheers!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900