sql - Grouping data in the select statement -
i have huge data needs classifed in different groups while retrieving. each group has different condition. don't want retrieve them separately. want know number of items in each group using single sql statement.
for example, pseudo code this:
select count(issueid) issue1_count if(condition1), count(issueid) issue2_count if(condition2), count(issueid) issue3_count if(condition3) table1, table2, tabl3 common_condition1 , common_condition2;
can me in making oralce query this...
put this:
select sum(case when condition1 1 else 0 end) issue1_count, sum(case when condition2 1 else 0 end) issue2_count, sum(case when condition3 1 else 0 end) issue3_count, table1, table2, tabl3 common_condition1 , common_condition2;
Comments
Post a Comment