Aggregation on condition

Certified Senior Developer

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