-
MSSQL - using count
Is it possible to join this query to itself
and then Sum the count of the [Hit] field to display it
within the same query?
Select
Distinct
Count (*) as [Total],
SiteName,
Grade,
(Select distinct Count(*)) as [Hit]
-- Sum(Hit) as [HitTotal]
From
Information
Group by
SiteName,
Grade
Order by
Sitename,
Grade
Total Sitename Grade Hit
165 West 30 1
147 West 31 1
127 West 32 1
113 East 30 1
99 East 31 1
I realize I will see the hit total sum on every record, but that would be ok.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|