Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 get data from multiple table
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

28 Posts

Posted - 08/21/2013 :  13:13:48  Show Profile  Reply with Quote
i have 3 tables
say table1 , table2 and table3
table1 have three columns say name,lastname, id2
table2 have 3 columns say details,id2,id3
table3 have 3 columns say payment,id3 ,session

i have to get data as
select * from table1
select * from table2 where
select * from table3 where id3=table2.id3 and session=something say 4

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 08/21/2013 :  13:23:59  Show Profile  Reply with Quote
SELECT t1.col1, t1.col2, t2.col1, ...
	Table1 t1
	INNER JOIN Table2 t2 ON t2.id2 =
	INNER JOIN Table3 t3 ON t3.id3 = t2.id2
WHERE	t3.[sessio]n = 4
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000