一个不行,用两个吧,
两种排序条件一条SQL不能完成

解决方案 »

  1.   

    怎么用两个SQL语句阿,听起来蛮新鲜的。说说看,是不是用子查询阿?我现在是没办法实现这个问题了。
      

  2.   

    select * from table2 left join table1 on table2.tid=tabl1.tid where table1.status=1 order by table2.time desc, table1.tid这样试试,应该可以
      

  3.   

    第一条
    select * from table2 left join table1 on table2.tid=tabl1.tid where table1.status=1 and table1.displayorder=0 order by table1.tid第二条
    select * from table2 left join table1 on table2.tid=tabl1.tid where table1.status=1 and table1.displayorder>0 order by table2.time
      

  4.   

    晕,用上面的sql语句倒是能查出东西来,但是当我再增加一个条件时就行了,不是语法错误,而是差到的数据为0条,本来能够查到数据的,好晕哦。