Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tag: part-06
Fetching contributors…

Cannot retrieve contributors at this time

12 lines (9 sloc) 0.296 kB
BEGIN;
CREATE VIEW books_with_authors AS
SELECT b.isbn, b.title, b.rating,
array_to_string(array_agg(a.surname), ', ') as authors
FROM books b
JOIN book_author ba ON b.isbn = ba.isbn
JOIN authors a ON ba.author_id = a.id
GROUP BY b.isbn, b.title, b.rating;
COMMIT;
Jump to Line
Something went wrong with that request. Please try again.