Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 3v0k4/3405d1ea055c0e8823e4abb7f2817a2b to your computer and use it in GitHub Desktop.
Save 3v0k4/3405d1ea055c0e8823e4abb7f2817a2b to your computer and use it in GitHub Desktop.
=> SELECT string_agg(title, ', ') as titles, genre, count(*) FROM films GROUP BY genre;
titles | genre | count
------------------------------+----------+-------
Blade Runner 2049, Inception | thriller | 2
Arrival | scifi | 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment