I have a select similar to 'select id from tbl where whatever'
i want to take this result and use in a 'where in ()
But sometimes the result might be null - and in these cases I like to retrive all rows
some like this
select * from tbl1 where
something = something and
if (select id from tbl2 where....) <> NULL
tbl1.fieldname in (select id from tbl2 where....)