Taking the record with the max date

前端 未结 6 1989
忘了有多久
忘了有多久 2020-12-08 10:05

Let\'s assume I extract some set of data.

i.e.

SELECT A, date
FROM table

I want just the record with the max date (for each value o

6条回答
  •  情歌与酒
    2020-12-08 10:28

    Justin Cave answer is the best, but if you want antoher option, try this:

    select A,col_date
    from (select A,col_date
        from tablename 
          order by col_date desc)
          where rownum<2
    

提交回复
热议问题