Hi How would I get the result (last table) from the above data sets. Displays all T2 where no barcodes appeared in T6.
asked Apr 12 at 04:11 AM in Default
There are many ways of getting the desired results. One way is to use a correlated subquery:
The other way is to use the left join:
Which of the 2 queries will perform better is not possible to tell without knowing the details about the data (indexes, record count, cardinalityof values etc., but is easy to check by highlighting both queries and hitting Ctrl + L in SSMS query window to display the estimated plans for both. These should reveal which query is better.
Hope this helps.