Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

how to retrieve max date time record for each ID (oracle)

$
0
0

i have two column, 1st column store the "ID and date" format (IDXXX-YYYYMMDD) where IDXXX is the record ID and 2nd column store the time. how can i retrieve the record which is latest date and latest time for each ID in sql in oracle?

ID_DATE                           TIME 

ID001-20170930              1750

ID001-20170930               1830

ID001-20171001               1030

ID001-20171002               1230

ID002-20171101               1000

my expected result as below

ID001-2017002                 1230

ID002-20171101                1000


Viewing all articles
Browse latest Browse all 1350

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>