Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"ON T1.id = T2.id" vs "ON T2.id = T1.id"

Status
Not open for further replies.

BigTeeJay

Technical User
Jun 13, 2001
106
US
Hey,
I havent been able to tell if the sytax of the
below makes a difference, does anyone know?

Consider...[tt]
SELECT T1.ID, T2.Name
FROM Table1 T1 INNER JOIN Table2 T2
ON T1.id = T2.id
[/tt]

versus...[tt]
SELECT T1.ID, T2.Name
FROM Table1 T1 INNER JOIN Table2 T2
ON T2.id = T1.id
[/tt]

...this is a case of 6 of one, and half-dozen of
the other right?

A co-worked of mine thought it might change the
order in which the results are sorted or something.
But I havent been able to prove that (and he claims
he doesnt have the time ;) yeah right).

Regards,
Tj

PS: Why cant I search for the word 'where', I can search
for 'select' and get a bunch of results (obviously), but
'where' returns none (I even verified that there were
indeed posts containing this word).
 
The order of the tables in the ON clause doesn't matter. I prefer to list the trables in the order they appear in the FROM clause.

The Tek-Tips search is still a work in process. Send problems to site support at support@tek-tips.com. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top