Oracle删除重复数据(2)
数据库  /  管理员 发布于 3年前   248
select 字段1,字段2,count(*) from 表名 group by 字段1,字段2 having count(*) > 1
delete from 表名 a where 字段1,字段2 in(select 字段1,字段2,count(*) from 表名 group by 字段1,字段2 having count(*) > 1)
CREATE TABLE 临时表 AS(select 字段1,字段2,count(*) from 表名 group by 字段1,字段2 having count(*) > 1)
delete from 表名 a where 字段1,字段2 in (select 字段1,字段2 from 临时表);
select a.rowid,a.* from 表名 a where a.rowid != ( select max(b.rowid) from 表名 b where a.字段1 = b.字段1 and a.字段2 = b.字段2 )
delete from 表名 a where a.rowid != ( select max(b.rowid) from 表名 b where a.字段1 = b.字段1 and a.字段2 = b.字段2 )
create table 临时表 as select a.字段1,a.字段2,MAX(a.ROWID) dataid from 正式表 a GROUP BY a.字段1,a.字段2; delete from 表名 a where a.rowid != ( select b.dataid from 临时表 b where a.字段1 = b.字段1 and a.字段2 = b.字段2 ); commit;
CREATE TABLE 临时表 AS (select distinct * from 表名);drop table 正式表;insert into 正式表 (select * from 临时表);drop table 临时表;
INSERT INTO t_table_bakselect distinct * from t_table;
路人 在
php中使用hyperf框架调用讯飞星火大模型实现国内版chatgpt功能示例中评论 教程很详细,如果加个前端chatgpt对话页面就完美了..博主 在
科学上网翻墙之v2rayN-Core客户端免费公益节点使用教程中评论 @ mashrdn 多切换几个节点测试,免费ssr是没那么稳..mashrdn 在
科学上网翻墙之v2rayN-Core客户端免费公益节点使用教程中评论 V2rayn免费节点添加上去了,youtobe无法打开网页,是怎么回事..张伟 在
科学上网翻墙之v2rayN-Core客户端免费公益节点使用教程中评论 3q!有用,不过免费节点隔天就要去git上复制新的导进去..博主 在
科学上网翻墙访问Google , 上外网神器佛跳墙VPN(永久免费)使用流程步骤中评论 该篇教程已不能用了,告知大家,免的老有老铁问我!..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号