|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
best approach "Where In' or join
Hi,
I have 2 sets Set1 has few UNIQUE items say workitem Ids 2,3,4 Set2 has multiple items say workitems Ids is 1,2,2,4,3,5,4,3,6,7,8 I need to look for Set1 in Set2 so i get 2,3,4 etc... which is the best way Set2 Left join Set1 OR Select item from Set2 where item in (Set1) |
|
#2
|
||||
|
||||
|
I would suggest the Where In clause, unless you wish to have many rows appearing.
A join will join every record from set1 to every record in set2 where the values are equal. Where IN will check the values of Set1 are present in Set2. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > best approach "Where In' or join |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|