SQLserver 查看表详细信息--删除重复数据
来源:互联网 发布:翻 墙软件 编辑:程序博客网 时间:2024/05/16 06:18
sp_help table_name --查询表详细信息sql server
desc tables table_name
删除重复数据:
1、oracle 中
delete borrowRecord --删除表名
where studentId in( --删除重复数据
select studentId from borrowRecord group by studentId having count(studentId)>1
)
and rowid not in( --保留重复数据中的一条数据
select min(rowid) from borrowRecord group by studentId having count(studentId)>1
)
2、SQL server中
delete BorrowRecord --BorrowRecord 表名
where studentId in(
select studentId from borrowRecord group by studentId having count(studentId)>1--找出重复的数据
)
and borrowid not in(
select min(borrowId) from borrowRecord group by studentId having count(studentId)>1--保留重复数据中的一条数据
)
3、删除所有重复的数据
delete from table_name
where id in(
select id from table_name group by id having count(id)>1
)
- SQLserver 查看表详细信息--删除重复数据
- 重复数据删除的详细信息
- SQLSERVER删除表内重复数据
- SQLServer 删除表中的重复数据
- SQLServer删除重复数据记录
- SqlServer怎么删除重复数据
- sqlserver 2008R2 删除一个表中的重复数据
- 查看SQLServer数据表的详细信息
- 查看SQLServer数据表的详细信息。
- sqlserver 2008 R2 删除重复数据
- ORACLE,SQLSERVER,DB2 删除重复数据SQL
- [SQLServer]如何删除表中的重复行
- SQLSERVER 删除重复记录
- SQLServer中删除重复数据的几个方法
- 几种在SQLServer中删除重复数据方法
- sqlserver中多行所有数据重复,无法更新或删除问题
- sqlserver中如何删除没有主键的重复数据。
- sqlserver sql 对重复数据的操作 查找 删除
- LeetCode 003-Longest Substring Without Repeating Characters
- ABAP程序编写过程中怎么提高程序执行效率一
- Intent(1)
- openfire 安全模式登陆
- Use Static Method in Powershell
- SQLserver 查看表详细信息--删除重复数据
- 【LeetCode从零单刷】Roman to Integer
- linux服务器开户:groupadd, useradd, passwd的使用
- java集合框架---泛型总结
- JAVA和Scala写文件类FileWriter/FileOutputStream/BufferedWriter
- FZU2136--取糖果 (线段树+RMQ)
- 快速幂模板(数+矩阵)
- phongap 命令行签名,apk签名成功,但是安装时提示包解析错误
- POJ2752 Seek the Name, Seek the Fame KMP-next数组的应用