怎么就没人上来帮个忙看看呐???晕,先顶上去...我想,是不是在使用in时,子查询不能返回多行的?也不像啊..嘎嘎.MYSQL真够BT的.

解决方案 »

  1.   

    id select_type table type possible_keys key key_len ref rows extra
    1 primary UsersState all Null Null Null Null 6591 Using where
    2 dependent_subquery Friends all Null Null Null Null 168200 Using where--------------------------------------
    回楼上的,结果是这么样的..嘎嘎..咋办呐??看不明白...
      

  2.   

    在 friends 表的 id 上加个索引, 试试.
    可能friend中数据太多了.
      

  3.   

    select uid from UserState where uid in (select * from (select fid from Friends where mid = 1) as table1)我晕,再在外面再包一层就OK了,日,可就是执行的时间要得有些长,有时有一两秒,有时只要0.1秒..嘎嘎...
      

  4.   

    friends表里确实有些多,十六W....
      

  5.   

    算了,谢谢各位的热心解答,结贴算了,不改那个那个啥了...在MYSQL里查询这一条要一百多MS,而MSSQL里只要五十多MS,嘎嘎...晕了...