In ms-sql i am using an aggregate group to filter results by user, i would also like to use case to filter by a row not contained in the aggregate so all the user results are on 1 line. I'm not sure this is possible.
Here is the query below which splits the results into two lines.
select case when col_A='1' then sum(col b) End as Sum1_results,
case when col_A='2' then sum(col_b) End as Sum2_Results, Username from tbl1
group by Username, col_A
example of results is.
Sum1_results | Sum2_results | Username
5499 null John
null 3400 John
Ideally, i would like to just have these results merged into one line for each username if possible. Any help would be appreciated