0

I have a table EVENT and a table ATTENDEE. When grouped by its lookup values EVENT looks like this:

|EVENT_ID|EVENT_TYPE|CITY|STATE|ZIP|

Many events can have many attendees, so I then have an EVENT_ATTENDEE junction table:

|EVENT_ID|ATTENDEE_ID|

I want to display the relevant contents of the EVENT table. My results would look something like this:

|EVENT_ID|EVENT_TYPE|CITY|STATE|ZIP|ATTENDEE_1|ATTENDEE_2|...|ATTENDEE_N|

Is there a way in SQL to accomplish this task?

Ben
  • 51,770
  • 36
  • 127
  • 149
Sean
  • 1
  • 3
  • Where are the rows of data? – Kaushik Nayak Dec 09 '17 at 19:34
  • I didn't include any in the example cause I thought it was unnecessary. – Sean Dec 09 '17 at 19:48
  • Why do you want a stored procedure? –  Dec 09 '17 at 22:11
  • I'm sorry, but I never said I wanted a stored procedure for this task. My thoughts would be a single select query that took the rows of a junction table and appended them to be columns of the respective 'parent' table ( I don't know what else to call it) – Sean Dec 10 '17 at 00:50
  • By saying PL/SQL you are stating that you want a stored procedure. PL/SQL is a procedural language. – Ben Dec 10 '17 at 07:37
  • We're using the Oracle 11g for a database. Its brand SQL is PLSQL. I said nothing about stored procedures – Sean Dec 10 '17 at 09:01
  • PL/SQL and SQL are different things. [PL/SQL is Oracle's procedural extension to SQL](https://en.wikipedia.org/wiki/PL/SQL). PL/SQL is _not_ the name of Oracle's SQL dialect. As soon as you mention PL/SQL in this context you're effectively talking about stored procedures or functions. – Ben Dec 10 '17 at 09:11

0 Answers0