I need to limit the result set for a SELECT statement based on Col1 to have 1-to-many potential values. For example, I want to return all rows where Col1 is 1, 2, and 3.
So far, I have two different approaches to limiting the result set:
Approach No. 1
Inner Join Table1 On (Table2.ColA=Table1.ColA) And (Col1=1 And Col1=2 And Col1=3)
Approach No. 2
Inner Join Table1 On Table2.ColA=Table1.ColA
Where (Col1=1 And Col1=2 And Col1=3)
Is one of these approaches preferable or is there an alternative approach that would be more effective? The values are dynamic and are passed to the stored procedure every time it is called.
Thank you, Chris
source
share