Quantcast
Channel: Answers for "sum and count with group by in a single column"
Browsing latest articles
Browse All 6 View Live

Answer by SirSQL

A little confused here, why not just use SUM instead of COUNT and eliminate your GROUP BY? Or make your existing select a group by SELECT SUM(BRRCompletedApr13) from (select...

View Article



Answer by mjharper

I think you just need to include AdjustedDateCompleted in your SELECT and COUNT the rows. So this: select AdjustedDateCompleted, COUNT(*) as BRRCompletedApr13 from dbo.shp_BRRPipelineRemediation where...

View Article

Answer by mjharper

The syntax error will be because AdjustedDateCompleted can't be summed as I guess it's a datetime field. To get both day by day and total I would do something like this: select AdjustedDateCompleted,...

View Article
Browsing latest articles
Browse All 6 View Live




Latest Images