select a.* from gbook a where a.re_id in (select b.re_id from gbook b where b.re_id>0 order by b.postdate desc limit 10 ) order by a.postdate desc limit 10

解决方案 »

  1.   

    好像 in(select....里面不能有limit
      

  2.   


    select a.* from gbook a where a.re_id in (select b.re_id from gbook b where b.re_id>0 order by b.postdate desc limit 10 ) order by a.postdate desc limit 10You have an error in your SQL syntax near 'select b.re_id from gbook b where b.re_id>0 order by b.postdate desc limit 10 )' at line 1楼上的兄弟,仍然出现错误哦~
      

  3.   

    select a.* from gbook a where a.re_id in (select b.re_id from gbook b where b.re_id>0 order by b.postdate) order by a.postdate desc limit 10You have an error in your SQL syntax near 'select b.re_id from gbook b where b.re_id>0 order by b.postdate desc limit 10 )' at line 1select a.* from gbook a where a.re_id in (select b.re_id from gbook b where b.re_id>0 order by b.postdate) order by a.postdate desc limit 0,10You have an error in your SQL syntax near 'select b.re_id from gbook b where b.re_id>0 order by b.postdate desc limit 10 )' at line 1都不行哦~ :(
      

  4.   

    mysql版本不够。
    在4。1上没问题(当然是说后面的两句)
    4。1里子从句仍然不可以带limit
      

  5.   

    多问一句,你的数据库是什么?
    mysql?版本?它不是所有版本都支持子查询的哦。
      

  6.   

    朋友,请关注一下此帖:
    http://community.csdn.net/Expert/topic/4338/4338855.xml?temp=.8305628