Hi,
Is it possible to place case inside having clause?
for example:
select field1, field2, sum(field3)
from tblMain
group by field1, field2
having sum(field3) > 0.1
I would like to do something like:
select field1, field2, sum(field3)
from tblMain
group by field1, field2
case when @param=1 then having sum(field3) > 0.1
so only do the having bit when @param = 1
Any thoughts please?
Thanks