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:
select * from (SELECT MEMBSHIP_ID FROM user_payment WHERE user_id=1 order by paym_date desc) where rownum=1;