create table test_dur (duration int)insert test_dur select 15insert test_dur select 150goselect sum((case when duration < 10 then 1 else 0 end)) as 'Less Than 10', sum((case when duration between 10 and 19 then 1 else 0 end)) as '10 - 19', sum((case when duration between 20 and 29 then 1 else 0 end)) as '20 - 29', sum((case when duration between 30 and 39 then 1 else 0 end)) as '30 - 39', sum((case when duration between 40 and 49 then 1 else 0 end)) as '40 - 49', sum((case when duration between 50 and 59 then 1 else 0 end)) as '50 - 59', sum((case when duration > 59 then 1 else 0 end)) as 'Greater than 59'from test_durgodrop table test_durgo
[edit]Apparently, when Rob and I used our powers of clairvoyance to mind-read your desired rowset, we had different visions.[/edit]<O>Edited by - Page47 on 07/16/2002 10:47:15