I want to declare a variable and do the following :
Select
cast (SUM(case when @Dummy is not null then 1 else 0 end)*1.0/443321 as decimal(10,5)) @Dummy
FROM hellotable
WHERE @Dummy in ("100 different field names in hellotable")
However this is not working... Any help is appreciated.