You are here: Re: How to select count records that "contain" data? « MsSQL Server « IT news, forums, messages
Re: How to select count records that "contain" data?

Posted by Spook on 09/19/07 22:38

I think this should work:


Select Name, Count (Status)
from <<tablename>>
where status ='complete'
group by Name
order by Name



"Terry Olsen" <tolsen64@hotmail.com> wrote in message
news:46f19892$0$508$815e3792@news.qwest.net...
>I have a table in SQL Server that looks like this:
>
> Name Status
> ---------------------------
> Steve Complete
> Steve In Queue
> John Pending
> John Complete
> John Complete
> Tim In Queue
>
> I need to throw a query at this that will return the number of
> "Complete"'s that each person has. So the result would look like:
>
> Name Completed
> ----------------------------
> Steve 1
> John 2
> Tim 0
>
> Can anyone help out with what a query statement would look like to get
> the desired output?
>
>
> *** Sent via Developersdex http://www.developersdex.com ***

 

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

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