2 Replies - 117 Views - Last Post: 27 October 2017 - 07:31 AM

#1 ikhlas06  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 178
  • Joined: 20-May 16

how to get max date?

Posted 26 October 2017 - 01:40 PM

i am using oracle sql

how to get max date?

below sql query will get the max date:

select distinct id, max(myDate) myDate 
from myTable group by id order by id 


but issues is if there are 2 same dates than it will return 2 dates. I just need the 1 latest date
Is This A Good Question/Topic? 0
  • +

Replies To: how to get max date?

#2 andrewsw  Icon User is online

  • the case is sol-ved
  • member icon

Reputation: 6379
  • View blog
  • Posts: 25,770
  • Joined: 12-December 12

Re: how to get max date?

Posted 26 October 2017 - 01:49 PM

You could lose the word 'distinct'

(Question move to Oracle subforum.)
Was This Post Helpful? 0
  • +
  • -

#3 ikhlas06  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 178
  • Joined: 20-May 16

Re: how to get max date?

Posted 27 October 2017 - 07:31 AM

View Postandrewsw, on 26 October 2017 - 01:49 PM, said:

You could lose the word 'distinct'

(Question move to Oracle subforum.)

I have tried this before. but still no luck
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1