I want to get sum quantity of A and B in new column named group1 and group 2 have distinct value with Category . And want to get both columns in same execution .
c1 | c2
---------------
A | 2
B | 1
A | 2
B | 1
A | 2
B | 1
result :
group1 | group2
---------------
A | 6
B | 3
I am trying this query but not working
SELECT SUM(c2) WHERE DISTINCT c1 in('A','B') as 'group2' from table,
SELECT DISTINCT c1 in('A','B') as 'group1' from table