Removing duplicates, is a challenging task.
Sometimes you need something special. Using DISTINCT/ GROUP BY / UNION is not enough.
You need to remove duplicates is some other way: using window function:
You can do it using following query:
If you would like to see how input data looks like. What is the expected result. When this approach might not be a good idea. Please continue reading.
Read More