
November 6th, 2009, 05:29 AM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 3
Time spent in forums: 19 m 26 sec
Reputation Power: 0
|
|
|
SQL Server 2005 - Nested SELECT statement to count table
Hi
I'm trying to run a count statement i also want a sum of that count column which i have created for count
SELECT SUM(NoofClients) AS Total (
SELECT Description, COUNT(Company) AS NoofClients FROM locations, clients
WHERE locations.LocationId=clients.LocationId AND Description Like '%Bedfordshire%'
GROUP BY Description
)
can anyone suggest how doest it will work.
Thanks in advance.
Regards
Arsalan
|