I have a table similar to this
| ID | Value |
|---|---|
| A | AA |
| A | AC |
| B | AB |
| B | AD |
This table is grouped by ID and I get a list of values
SELECT ID, LISTAGG(value, ', ') WITHIN GROUP (ORDER BY value)
FROM table
GROUP BY ID
All possible values are AA, AB, AC, AD. I would like to show the missing values. So the results should be
| ID | Value |
|---|---|
| A | AB, AD |
| B | AA, AC |
Is there any elegant way to solve this? I am working on oracle 19