I have a select which is conditional. So, basically, if it would only be that one, I would put that into a IF and only execute that SQL if the condition matches. However, when the condition matches, I need to include that with a Union. So, what is the best way to achieve that. Here is an example:
SELECT Client.Title FROM Client WHERE Client.NoProvince=22
UNION
SELECT Client.Title FROM Client WHERE Client.NoProvince=23
So, basically, in some circumstances, the first select should not be considered.
Or, is simply putting that select into the first part of the IF and the smaller select in the Else would do?