Skip to content

Instantly share code, notes, and snippets.

@dgorodnichy
Last active May 13, 2024 15:47
Show Gist options
  • Save dgorodnichy/18a46a5ae91550c4e599f72fac6ae3d6 to your computer and use it in GitHub Desktop.
Save dgorodnichy/18a46a5ae91550c4e599f72fac6ae3d6 to your computer and use it in GitHub Desktop.
SELECT row_number() OVER () AS id,
AVG(rate) AS rate,
Films.id AS film_id,
Films.title AS title,
Films.genre AS genre
FROM Films
LEFT OUTER JOIN Reviews ON Reviews.film_id=Films.id
GROUP BY Films.id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment