Reply to Re: Subquery headache with Count and GroupBy

Your name:

Reply:


Posted by Robert Klemme on 11/22/05 18:57

laurenq uantrell wrote:
> Jees! I'd better start drinking coffee in the morning!

:-))

> Thanks.

In fact there was a typo - 1 "select" too much:

select @EmployeeCities = count(distinct City) from tblEmployees

> I must
> have wasted 30 minutes trying to put a GROUPBY subquery inside a COUNT
> subquery before seeking help!

You mean like

select @EmployeeCities = count(*) from (select City from tblEmployees
group by City) x

?

Cheers

robert

[Back to original 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

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