View Single Post

   
  #2 (permalink)  
Old 03-01-2008, 03:49 PM
Mark
 
Posts: n/a
Default Re: Query - select common data from one column and display in severalcolumns

select Name,
sum(case when note=5 then 1 else 0 end) as note5,
sum(case when note=4 then 1 else 0 end) as note4
from mytable
group by Name
Reply With Quote