Multiple rows into a comma delimited list in PL/SQL

Multiple rows

One common thing to request is data from multiple rows into a comma delimited list in PL/SQL. If you are using Oracle 11g or greater there are a couple of options. The first is pretty verbose and difficult to follow but it is here for reference and posterity.

LISTAGG

Kind of messy and a little hard to follow. There is a new option in 11g that makes things a lot cleaner and easier.

That is a lot cleaner and easier to understand. The new LISTAGG function makes taking multiple rows into comma delimited list in PL/SQL much easier and faster.