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.
Author |
Topic |
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2007-07-30 : 12:28:29
|
hi,what is the main difference of using join or using exists.e.g.1.select t1.id, t1.name from table1 t1 join table2 t2 t2.id = t1.id join table3 t3 t2.id = t3.idwhere t1.name like '%something'e.g.2.select t1.id, t1.name from table t1where t1.name like '%something'and (select t2.id from table2 t2 join table3 t3 t2.id = t3.id)what is the main difference and how does this impact on the output?thanx |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-07-30 : 12:48:21
|
Any join can produce unwanted result by duplicating a record.An exists check works much like IN but more efficient. E 12°55'05.25"N 56°04'39.16" |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
|
|
|
|