Skip to content
Advertisement

Select only the records with same values

I am working on a SQL statement that will become a part of a view. What I need is to extract only the records that have the same unique key twice. The query looks like below right now.

The result I get from the query above is:

enter image description here

I need to modify the SQL statement so that the end result is like below:

enter image description here

How can I modify the above statement to spit out the end result like that?

Advertisement

Answer

Use the analytic count(*) over () function.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement