Saturday, February 25, 2012

A question in SQL

Hi..
I have a question in SQL..
How can i make SELECT from two or more tables?Select a.col, b.col , a.id from table1 a, table2 b where a.id=b.id

This is one way! I am not sure what kind of query you wanted to run!|||Sreedhar has given you one method...For further information you might want to read up on JOINs in SQL Server's Books OnLine.|||A link to the MSDN library site that talks about the different join methodologies. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_09_66b7.asp

Personally, I would avoid Sreedhark's suggestion since it's an old join methodology that's becoming obsolete.

No comments:

Post a Comment