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:
Try with:
select TO_CHAR(dates,'dd/MM/yyy hh24:mi') from ( SELECT min (TO_DATE(a.PAYM_DATE)) as dates from user_payment a )