oracle 查某一列有重复值的记录
-- 查找重复记录
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)
代码是使用表变量进行的处理
最新文章
- [vijos1459]车展
- PHP function
- Spring事务管理(转)
- 【python】id()函数
- $(function(){})与window.onload的区别
- Yii2.0中文开发向导——Yii2中多表关联查询(join、joinwith)
- Drainage Ditches(Dinic最大流)
- Yii框架中ActiveRecord使用Relations
- SVN的初步使用方法
- JavaScript 进阶(五)易混淆概念null vs undefined, == vs ===, string vs String
- ECshop lib_base.php on line 1241 错误解决方法
- wampServer 2.5 64位 更改";www 目录";不成功
- JPEG流封装AVI视频
- C#中await和async关键字的简单理解
- Docker基本架构
- php开启fileinfo扩展
- GlashFish部署的程序时好时坏,无法访问时报404
- Badboy教程
- NOSQL -- mongoDB的了解与安装(Wins10)
- PHP 弹窗 源代码 css Jquery.js
热门文章
- 1月5日 对象Object, 含过去看的英文档的总结链接
- hdu-1907-反nim博弈
- python 爬取京东手机图
- iOS UI-微博案例(通过代码自定义Cell)
- Oracle数据库的“健康指示器”——事件(events)
- 微信小程序 -- 数据请求
- NOIP初赛 BLESS ALL!
- 微信小程序wx.chooseImage和wx.previewImage的综合使用(图片上传不限制最多张数)
- [C#]C#彩色扭曲验证码
- 读书笔记 C# Linq查询之group关键字浅析