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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Joining tables question

Author  Topic 

drew22299
Starting Member

26 Posts

Posted - 2009-01-22 : 07:58:05
Hi,

Is any difference in joining tables if you put the other table name in the from clause?

for example, the two queries below return the same results but the table names are different in the from clause - is there any situation where it would be improtant which table name goes after from?

select User.UserUID, User.Username, LoginDetails.LastLogin
from LoginDetails
Inner Join User ON LoginDetails.UserUID= User.UserUID
order by LoginDetails.LastLogin asc


select User.UserUID, User.Username, LoginDetails.LastLogin
from User
Inner Join LoginDetails ON User.UserUID = LoginDetails.UserUID
order by LoginDetails.LastLogin asc

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-01-22 : 07:59:29
there is no difference in inner join it will check as 1-1 relation
it will differ from left , right joins
Go to Top of Page

drew22299
Starting Member

26 Posts

Posted - 2009-01-22 : 08:13:51
Thanks!
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-01-23 : 00:19:14
welcome
Go to Top of Page
   

- Advertisement -