本帖最后由 twtetgso 于 2010-07-12 16:51:24 编辑

解决方案 »

  1.   


    select x1,doctime,doctitle from (
    select x1,row_number() over(partition by x1 order by doctime desc) rn,doctime,doctitle from A) where rn = 1
      

  2.   


    select x1,doctime,doctitle 
    from A
    where rowid in
    (
       select max(rowid) from A group by x1
    )
      

  3.   

    --楼主近日都看见你在发帖 呵呵--这个可以用分析函数搞定
    1
    select docid,xl,doctime,doctitle
    (select docid,xl,doctime,doctitle,row_number() over(partition by x1 order by doctime desc) rn
    from A) t
    where rn=12.
    select * from A t where exists (select 1 from A  where a.x1=x1 and a.doctime>doctime)
      

  4.   


    SELECT * FROM A WHERE doctime IN(
    SELECT max(doctime)
    FROM A
    GROUP BY x1)