MAX(DATE) - SQL ORACLE

前端 未结 5 2110
感动是毒
感动是毒 2021-02-20 03:03

I want to select only the latest membership_id from table user_payments of the user with the user_id equal to 1.

This is how the table user_payment looks like:



        
5条回答
  •  野的像风
    2021-02-20 03:11

    select * from 
      (SELECT MEMBSHIP_ID
       FROM user_payment WHERE user_id=1
       order by paym_date desc) 
    where rownum=1;
    

提交回复
热议问题