Click here to Skip to main content
15,921,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have created three table table1 BookingDetails,table2 Customerdetails,table3 booking, i want to get the details from table2 and table3 ...in all tables customerid is common....
and the details in the table3 are saved with the id's not name....example towerid ,flatid and i need tower name and flat name...and these are stored in another two tables table4 towermaster,table5 flat master,and in this there is no customerid...only towerid and flatid...how its possible it will possible are not??

thnk q
Posted
Updated 12-Sep-12 20:02pm
v2
Comments
Kuthuparakkal 13-Sep-12 2:02am    
Learn SQL Join
_Amy 13-Sep-12 2:31am    
:thumbsup: I could have given you +5 for this comment. :)
rajushyamu7 13-Sep-12 5:17am    
thank you.

1 solution

As suggested, you need a JOIN statement:

Get name from other table:
Alias has AKAName and ActorID
Actors has Name and Id

SQL
SELECT a.Name, b.AKAName
 FROM Actors a JOIN Alias b ON a.Id = b.ActorId
 
Share this answer
 

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