How to apply Aggregation (grouping) based on condition as like Group by on condition in Mysql?
Example: SELECT * FROM `TABLE` GROUP BY ( CASE WHEN `NAME` = 'AA' THEN `COLUMN1` ELSE `COLUMN2` END );
Discussion posts and replies are publicly visible
You will need to create two different queries with the different filters as name=aa and otherwise. Or you can go with what Stefan said.