You are here: Re: SQL Counting number of non-distinct rows? « MsSQL Server « IT news, forums, messages
Re: SQL Counting number of non-distinct rows?

Posted by Ronnie Chee on 05/03/06 19:52

"David" <david.goodyear@gmail.com> wrote in message
news:1146673034.443139.173600@j33g2000cwa.googlegroups.com...
> Hi, I have a table that for ease has this data in:
>
> R1, R2, R....z
> ---------------------
> A | 12
> A | 22
> A | 30
> B | 0
> B | -1
> B | -3
> C | 100
>
> I want to generate a table for each distinct row in R1, gives a count
> of all the rows with data corresponding
>
> For the above table I would get
>
> A | 3
> B | 3
> C | 1
>
> Im probably being stupid but cannot see this at the moment... please
> help.
>
> Thanks
>

Look at the "GROUP BY" clause.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация