I have a query which looks like
SELECT * FROM mytable mt
WHERE 1=1
AND mt.column_1 IN (SELECT id FROM employee WHERE salary >10000)
OR mt.column_2 IN (SELECT id FROM employee WHERE salary >10000)
I know the above query is not looking good even though it is getting my job done. I did google but could not find help. The reason I ask is the actual scenario the 'employee' table is temp table which is filled with data at the upper levels of the strored_procedure and this particular is my final select statement for the procedure.