select * from (select * from city where names like '%xxx%' limit 10) where names like '$xxx%' order by names错误提示:Every derived table must have its own alias应该怎么改呀?

解决方案 »

  1.   

    select * from city where names like '%xxx%' order by names limit 10;
      

  2.   

    select * from city where names like '%xxx%' and names like '$xxx%' order by names limit 10;
      

  3.   

    select * from (select * from city where names like '%xxx%' limit 10) where names like '$xxx%' order by names
    分析下:
    select * from (table)这个table要是一个表
    select * from city where names like '%xxx%' limit 10这个很明显不符合,差了很远所以你那句很明显是错误的
      

  4.   

    我没去验证()里面放limit可不可以哈 但根据错误提示应该是这个意思select * from (select * from city where names like '%xxx%' limit 10) t where names like '$xxx%' order by names