Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WITH common_releases AS (
- SELECT release
- FROM public.release_label
- GROUP BY release
- HAVING count(*) > 1
- ), common_releases_labels AS (
- SELECT label
- FROM public.release_label
- INNER JOIN common_releases
- ON public.release_label.release = common_releases.release
- )
- SELECT DISTINCT id, name
- FROM public.label
- INNER JOIN common_releases_labels
- ON public.label.id = common_releases_labels.label
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement