Skip to content

Instantly share code, notes, and snippets.

@gmyrianthous
Last active September 4, 2022 14:05
Show Gist options
  • Save gmyrianthous/0453dc9c3558966c7914724503a0b886 to your computer and use it in GitHub Desktop.
Save gmyrianthous/0453dc9c3558966c7914724503a0b886 to your computer and use it in GitHub Desktop.
SELECT DISTINCT ON (customer_id) customer_id, store_id
FROM rental;
/*
|customer_id|store_id|
|-----------|--------|
| 58 | 2 |
| 100 | 4 |
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment