I'm looking to improve the queries I have in a statistics page from a survey. I have a lot of queries that look like:
I'd like to be able to run these queries together (into a single query ?) to get a result table that looks:
Any thoughts or suggestions would be appreciated.
[plug=shameless]
[/plug]
Code:
select case
when(stream=0) then 'Do not Use, Not Interested'
when(stream=1) then 'Do not User, Would Like To'
when(stream=2) then 'Use in Some Courses'
when(stream=3) then 'Use in all courses'
else 'Undecided'
end as title,
count(*) as num
from techsur group by stream order by stream
select case
when(pod=0) then 'Do not Use, Not Interested'
when(pod=1) then 'Do not User, Would Like To'
when(pod=2) then 'Use in Some Courses'
when(pod=3) then 'Use in all courses'
else 'Undecided'
end as title,
count(*) as num
from techsur group by pod order by pod
I'd like to be able to run these queries together (into a single query ?) to get a result table that looks:
Code:
title | num_pod | num_stream
Do not use, not interested | 5 | 20
[red]. . .[/red]
Any thoughts or suggestions would be appreciated.
[plug=shameless]
[/plug]