Skip to content
Advertisement

Retrieve the first data from multiple almost the same or correct data in table

How can i retrieve a data from query that has multiple the same data?. Something like this. I have a data representation like this:

Now i want to return something like these with parameter where date = 2019-09-09 :

i want to return the first data that was inserted.

Advertisement

Answer

Using ROW_NUMBER:

If you are using a version of MySQL earlier than 8+, then use:

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