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
select x1,doctime,doctitle from A where rowid in ( select max(rowid) from A group by x1 )
--楼主近日都看见你在发帖 呵呵--这个可以用分析函数搞定 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)
SELECT * FROM A WHERE doctime IN( SELECT max(doctime) FROM A GROUP BY x1)
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
select x1,doctime,doctitle
from A
where rowid in
(
select max(rowid) from A group by x1
)
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)
SELECT * FROM A WHERE doctime IN(
SELECT max(doctime)
FROM A
GROUP BY x1)