What the best way to work around this? I have the same SELECT statement but there are different criteria depending on the IF check.
I wrote a query (with lots of help, see my painfully plentiful other threads) using a correlated subquery and it takes 5.78 ...