Howdy
Running Postgres 7.1.3 on RedHat Linux 7.2 kernel
2.4.7 - 10.
Wonder if it is possible to get multiple counts
from ONE query using the CASE statement.
I'm trying to set something up like this:
select count (*)
case
when logic = '1' then 'First'
when logic = '2' then 'Second'
when logic = '3' then 'Third'
else 'Error'
end as 'Count'
from temp_table
;
I wonder if this is even possible? Maybe I can
try to create a variable (place holder) and
loop? I don't want to have to create many
versions of one program to count for each "logic"
in the table.
Suggestions?
Thanks!
-X