Created
March 31, 2020 18:29
-
-
Save tejpaldev/143db88ae543f7c373654a92a48a509a 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