Skip to content
Advertisement

Query to filter duplicate rows for particular column values

I have below table with given values:-

Need query to filter Below ResultSet:

I need a single row for a given Parent_code. If there are multiple Parent_code, then I have to look for highest Course_Version, if even Course_version’s are same, then I have to look for course_locale=’en_US’ only. And if even course_locale are same, then lastly I have to check for highest timestamp value.

Note: No primary key

Priority:-1st highest course_version, 2nd course_locale=’en_US’, 3rd timestamp

Advertisement

Answer

Solution 1:

Solution 2:

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