Oracle 查询出来的数据取第一条 --------------------------------------------------------------------------- 转载自:http://www.itpub.net/thread-246442-1-1.html select * from (select * from <table> order by <key>) where rownum=1; select * from (select * from &l
oracle 分组取第一行数据 SELECT * FROM ( SELECT ROW_NUMBER() OVER(PARTITION BY x ORDER BY y DESC) rn, t.* FROM test1 t ) WHERE rn = 1; 查找oracle 执行的语句 select t.*from v$sqlarea t where t.FIRST_LOAD_TIME like '2018-11-05%' order by t.FIRST_LOAD_TIME desc
检查重复记录 -- 检查重复code1 select count(identity) num, identity from event_log where code='code1' order by num desc 删除重复记录 DELETE FROM event_log WHERE `code`='code1' AND identity IN ( SELECT identity from ( ) a ) AND id NOT IN ( SELECT keepId FROM ( ) b ) 其