I have multiple group by queries that I need to be join horizontally. Here is what I have.
Here is what I need. Is this doable?
select Group, Count([Total # Records] from table select Group, Count([Total # Records] from table where [Date] < DATEADD(DAY, -60, getdate())
Use conditional aggregation:
select Group, Count([Total # Records]), sum(case when [Date] < DATEADD(DAY, -60, getdate() then 1 else 0 end) from table group by group;
1.4m articles
1.4m replys
5 comments
56.9k users