Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 12 lines (9 sloc) 0.296 kb
444f13a @theory Add `books_with_authors` view.
authored
1 BEGIN;
2
3 CREATE VIEW books_with_authors AS
4 SELECT b.isbn, b.title, b.rating,
5 array_to_string(array_agg(a.surname), ', ') as authors
6 FROM books b
7 JOIN book_author ba ON b.isbn = ba.isbn
8 JOIN authors a ON ba.author_id = a.id
9 GROUP BY b.isbn, b.title, b.rating;
10
11 COMMIT;
Something went wrong with that request. Please try again.