高手请帮忙看句sql,为什么order by 不起作用select sname from station
where sid in
  (
      select sid from relationinfo
      where tid =
        (
            select tid from traininfo
            where tname='abc'
         )
         order by sequence
   );

解决方案 »

  1.   

    order by sequence 

    order by sequence 里面 有什么意义?? 没用啊
      

  2.   

    order by sequence
    在where sid in 里面 有什么意义?? 没用啊 
      

  3.   

    relationinfo 表中有sequence 字段吗?order by sequence 放在where sid in里面没有什么意思吧 
      

  4.   

    select sname ,sequence from station ,relationinfo ,traininfo
    where station.sid=relationinfo.sid and
          relationinfo.tid=raininfo.tid and
          traininfo.tname='abc'order by sequence 
    如果这个不对的话,最重要的我是想说,order by 后的要在select要有,才可以排序。
      

  5.   

    select sname ,sequence from station ,relationinfo ,traininfo 
    where station.sid=relationinfo.sid and 
          relationinfo.tid=raininfo.tid and 
          traininfo.tname='abc' order by sequence 
    如果这个不对的话,最重要的我是想说,order by 后的要在select要有,才可以排序。