查找重复记录:
select names,num
from test
where rowid != (select max(rowid)
from test b
where b.names = test.names and
b.num = test.num)
查找表TEST中时间最新的前10条记录:
select * from (select * from test order by dates desc) where rownum < 11
本文介绍两种实用的SQL查询技巧:一是如何找出表中的重复记录;二是如何选取时间最新的前10条记录。
查找重复记录:
select names,num
from test
where rowid != (select max(rowid)
from test b
where b.names = test.names and
b.num = test.num)
查找表TEST中时间最新的前10条记录:
select * from (select * from test order by dates desc) where rownum < 11

被折叠的 条评论
为什么被折叠?