-- 查找重复记录
select names,num
from test
where rowid != (select max(rowid)
                 from test b
                where b.names = test.names and
                      b.num = test.num)

或者使用

select names,num
from test
where rownum!= (select max(rownum)
                 from test b
                where b.names = test.names and
                      b.num = test.num)

对于sql server 的使用可能没有oracle 那么方便

如下:

declare @table table(
  id nchar(20),
  name nchar(10),
  number int
  )
  insert into @table  select id,name, row_number() over(order by id)  number from userapp
  --select *from @table
   select a.id,a.name
from @table a
where number!= (select max(number)
                 from @table b
                where b.id = a.id and
                      b.name = a.name)

代码是使用表变量进行的处理

最新文章

  1. [vijos1459]车展
  2. PHP function
  3. Spring事务管理(转)
  4. 【python】id()函数
  5. $(function(){})与window.onload的区别
  6. Yii2.0中文开发向导——Yii2中多表关联查询(join、joinwith)
  7. Drainage Ditches(Dinic最大流)
  8. Yii框架中ActiveRecord使用Relations
  9. SVN的初步使用方法
  10. JavaScript 进阶(五)易混淆概念null vs undefined, == vs ===, string vs String
  11. ECshop lib_base.php on line 1241 错误解决方法
  12. wampServer 2.5 64位 更改"www 目录"不成功
  13. JPEG流封装AVI视频
  14. C#中await和async关键字的简单理解
  15. Docker基本架构
  16. php开启fileinfo扩展
  17. GlashFish部署的程序时好时坏,无法访问时报404
  18. Badboy教程
  19. NOSQL -- mongoDB的了解与安装(Wins10)
  20. PHP 弹窗 源代码 css Jquery.js

热门文章

  1. 1月5日 对象Object, 含过去看的英文档的总结链接
  2. hdu-1907-反nim博弈
  3. python 爬取京东手机图
  4. iOS UI-微博案例(通过代码自定义Cell)
  5. Oracle数据库的“健康指示器”——事件(events)
  6. 微信小程序 -- 数据请求
  7. NOIP初赛 BLESS ALL!
  8. 微信小程序wx.chooseImage和wx.previewImage的综合使用(图片上传不限制最多张数)
  9. [C#]C#彩色扭曲验证码
  10. 读书笔记 C# Linq查询之group关键字浅析