September 26, 2012 at 6:05 am
Hi Friends,
I have a doubt regarding joining two tables, so i came here to get your suggestions...
What is the differece between the below two queries ? What difference we can see in the result ?
Could you guys give me valuable suggestions,please?
select * from table1 join table2 on table1.column = table2.column and table2.column > 100
select * from table1 join table2 on table1.column = table2.column where table2.column > 100
Thanks,
Charmer
September 26, 2012 at 6:17 am
This was removed by the editor as SPAM
September 26, 2012 at 6:35 am
As written, they'll do the same thing. Check the execution plans, you'll see what they're doing.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
September 26, 2012 at 7:00 am
Charmer (9/26/2012)
Hi Friends,I have a doubt regarding joining two tables, so i came here to get your suggestions...
What is the differece between the below two queries ? What difference we can see in the result ?
Could you guys give me valuable suggestions,please?
select * from table1 join table2 on table1.column = table2.column and table2.column > 100
select * from table1 join table2 on table1.column = table2.column where table2.column > 100
Thank you Stewart , That make sense to me...If you don't mind, Could you gimme an example queries ..?
Thanks,
Charmer
September 26, 2012 at 7:05 am
Charmer (9/26/2012)
Charmer (9/26/2012)
Hi Friends,I have a doubt regarding joining two tables, so i came here to get your suggestions...
What is the differece between the below two queries ? What difference we can see in the result ?
Could you guys give me valuable suggestions,please?
select * from table1 join table2 on table1.column = table2.column and table2.column > 100
select * from table1 join table2 on table1.column = table2.column where table2.column > 100
Thank you Stewart , That make sense to me...If you don't mind, Could you gimme an example queries ..?
select * from table1 left join table2 on table1.column = table2.column and table2.column > 100
select * from table1 left join table2 on table1.column = table2.column where table2.column > 100
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 26, 2012 at 7:15 am
This was removed by the editor as SPAM
September 26, 2012 at 8:09 am
Thank you so much Stewart....This example is going to help me a lot...I made lot of mistakes in my T-SQL statements with this join with AND , join with WHERE...
I gotta change everything....You really helped me ....:-)
Thanks,
Charmer
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply