For your example (up to two rows per ID) there's a simple solution:
SELECT ID, Customer,
MIN(Book) || COALESCE(',' || MAX(Book), ''), SUM(Price)
FROM tab
GROUP BY 1, 2
But it's probably more complicated and i don't have a clue what you actually want.
Dieter
For your example (up to two rows per ID) there's a simple solution:
But it's probably more complicated and i don't have a clue what you actually want.
Dieter