Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
younas02
Starting Member
28 Posts |
Posted - 2013-08-21 : 13:13:48
|
i have 3 tablessay table1 , table2 and table3table1 have three columns say name,lastname, id2table2 have 3 columns say details,id2,id3table3 have 3 columns say payment,id3 ,sessioni have to get data asselect * from table1 thenselect * from table2 where id2=table1.idthenselect * from table3 where id3=table2.id3 and session=something say 4 |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-08-21 : 13:23:59
|
[code]SELECT t1.col1, t1.col2, t2.col1, ...FROM Table1 t1 INNER JOIN Table2 t2 ON t2.id2 = t1.id INNER JOIN Table3 t3 ON t3.id3 = t2.id2WHERE t3.[sessio]n = 4[/code] |
|
|
|
|
|