mysql子查询不支持limit的解决办法

mysql的子查询不支持limit。无奈百度。google之。解决方法是在前面再加一层select,例:

select * from weibo where id in (select id from weibo order by id desc limit 10);

报错

ERROR 1235 (42000): This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery’

加一层SELECT

SELECT * from weibo where id in (select id from (select id from weibo order by id desc limit 10)as a) limit 1;