-
-
Save priyankakundu/e297fe4fb8745c61d7355f4092b804e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select f.*, | |
count(*) over ( | |
partition by title, uk_release_date | |
) ct | |
from films f; | |
select * | |
from ( | |
select f.*, | |
count(*) over ( | |
partition by title, uk_release_date | |
) ct | |
from films f | |
) | |
where ct > 1 | |
Or you could use the with clause: | |
with film_counts as ( | |
select f.*, count(*) over (partition by title, uk_release_date) ct | |
from films f | |
) | |
select * | |
from film_counts | |
where ct > 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment