Return non-repeated lines in a Select

Asked

Viewed 26 times

1

I am using the following select on oracle

select DISTINCT delivery, dt_coletado from table1

and is returned to the following line

 DELIVERY      DT_COLETADO
8816619995  2019-05-17 00:51:04
8816619995  2019-05-16 20:06:56

I want to know a way to return only the row that has the date of the column DT_COLETADO larger. That in the case is the row with the date of day 17-05-2019.

1 answer

2


SELECT
    delivery, max(dt_coletado)AS dt_coletado
FROM table1
GROUP BY delivery
  • Thank you very much Silvair L. Soares. It worked.

  • It is a pleasure for me to be able to help. Good luck.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.