SQL Server aggregated report example

An example of how to make an aggregated report, grouping together by values:


    select  count(*) as total ,
        count(case WHEN others = 1 THEN 1 END)    as [one url],
        count(case WHEN others = 2 THEN 1 END)    as [two urls],
        count(case WHEN others = 3 THEN 1 END)    as [three urls],
        count(case WHEN others > 3 THEN 1 END)    as [all the rest]
        from #temp2
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted @ Sunday, September 16, 2007 4:16 PM
Print

Comments on this entry:

# re: SQL Server aggregated report example

Left by türk porno izle at 3/26/2009 7:59 PM
Gravatar
Good example, thanks...

# re: SQL Server aggregated report example

Left by SMF Destek at 3/26/2009 10:28 PM
Gravatar
Hı :) Thank you good post...

SMF Destek

# re: SQL Server aggregated report example

Left by Tc at 10/22/2010 12:05 AM
Gravatar
Hi, Its really a nice example. Thank you very much

# re: SQL Server aggregated report example

Left by Trxbox at 12/11/2010 7:58 PM
Gravatar
Thanks for the post. nice

# re: SQL Server aggregated report example

Left by sanalcadı at 2/8/2011 4:59 PM
Gravatar
This is a nice post but after carefully following the links posted, some are irrelevant and some are not free and that is misguiding information.

Your comment:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910