Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Obtenha o valor MAX na consulta mysql

Select Id,mid,userid,remarks from sample Where id<(select max(Id) from sample)
order by id desc limit 1

Ou
Select Id,mid,userid,remarks from sample 
order by id desc limit 1 offset 1