SELECT  title, times FROM  item1  WHERE title LIKE '%" + Replace(Recordset1__MMColParam, "'", "''") + "%'    Union all (SELECT  title, addtimes as times FROM item2  WHERE title LIKE '%" + Replace(Recordset1__MMColParam, "'", "''") + "%' order by ....写times?addtimes?怎么写?

解决方案 »

  1.   

    select * from 
    (
      SELECT  title, times FROM  item1  WHERE title LIKE '%" + Replace(Recordset1__MMColParam, "'", "''") + "%'   
      Union all 
      (SELECT  title, addtimes as times FROM item2  WHERE title LIKE '%" + Replace(Recordset1__MMColParam, "'", "''") + "%' 
    ) t
    order by times,addtimes
      

  2.   

    select * from 
    (
      SELECT  title, times FROM  item1  WHERE title LIKE '%" + Replace(Recordset1__MMColParam, "'", "''") + "%'   
      Union all 
      (SELECT  title, addtimes as times FROM item2  WHERE title LIKE '%" + Replace(Recordset1__MMColParam, "'", "''") + "%' 
    ) t
    order by times
      

  3.   

    order by times就可以了,除第一个以外,其他的不用AS列名!
      

  4.   

    对啊,我原来的就是对的,刚试过了,select * from根本就不要加的,我这个白痴试也不试就来问了,便宜老乌龟了.