oracle删掉重复数据的语法
时间:2021-07-01 10:21:17
帮助过:2人阅读
查询重复数据--
SELECT XYH,
COUNT(
*)
FROM BGJL
GROUP BY XYH
having(
count(
*)
>1)
--删掉重复数据--
DELETE from BGJL
WHERE (XYH)
IN (
SELECT XYH
FROM BGJL
GROUP BY XYH
HAVING COUNT(XYH)
> 1)
AND ROWID
NOT IN (
SELECT MIN(ROWID)
FROM BGJL
GROUP BY XYH
HAVING COUNT(
*)
> 1);
oracle删掉重复数据的语法
标签: