I have the following tables:
ALERT (ID,Name)
1 | Alert A
2 | Alert B
ALERT_BRAND_XREF (ALERT_ID, BRAND_ID)
1 | 1
1 | 2
2 | 1
BRAND (ID, NAME)
1 | Brand A
2 | Brand B
I am trying to write one statement to return a list of alerts with the applicable brands as a CSV list in one field. Desired results:
Alert A | Brand A, Brand B
Alert B | Brand A
Is there a way to do this without writing a separate function? I would like to do it in one self-contained SQL statement if possible.
This is Oracle 9i.