我想应该是
select * from (select * from userinfo order by id desc) limit 把limit子句放在外面,
不知道你什么数据库?