SELECT Id
,Password
,Amount
,@curRow := @curRow + 1 AS row_number
FROM sample JOIN (SELECT @curRow := 0) r
where id=1
order by Row_number
desc limit 3;
SELECT Id
,Password
,Amount
,@curRow := @curRow + 1 AS row_number
FROM sample JOIN (SELECT @curRow := 0) r
where id=1
order by Row_number
desc limit 3;