select * from table1,table2
where table1.f_id =table2.f_id 
order by table1.f_ctime desc

解决方案 »

  1.   

    谢谢楼上的好人,不过这不是我要的效果:( 
    是要取2张表的所有信息,然后按结果集的f_ctime倒序排,不需要table1.f_id =table2.f_id,也不是按其中某张表排序。
    应该怎么写呢
      

  2.   

    (SELECT f_id,f_title,f_link,f_ctime table1)
    UNION
    (SELECT f_id,f_title,f_link,f_ctime table2)
    ORDER BY f_ctime DESC
      

  3.   

    谢谢 redhatcnSELECT f_id,f_title,f_link,f_ctime FROM table1 
    UNION 
    SELECT f_id,f_title,f_link,f_ctime FROM table2 
    ORDER BY f_ctime DESC