Skip to content
Advertisement

Get the max date time in a table with multiple entries for each date

I have a table that has

And I only want one row per date, preferably the max, so the result should be

I’ve tried using a nested query in where:

but it only gives me back 1 row.

The table will have continuous dates also, like

etc.

And I need results for each date.

Advertisement

Answer

use corelated subquery

you can do it using row_number() if your dbms support

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