日期:2014-05-16 浏览次数:20338 次
delete from (select * from (select a,b,c,row_number() over(partition by a,b,c order by a,b,c) as row_num from tab) as e where row_num >1)
Create table emp_profile_temp like emp_profile;
LOAD FROM CURSUR DECLARE mycursor CURSOR FOR SELECT distinct * FROM emp_profile; LOAD FROM mycursor OF CURSOR INSERT INTO emp_profile_temp; drop table emp_profile; rename table emp_profile_temp to emp_profile
DELETE FROM (SELECT ROWNUMBER() OVER (PARTITION BY column name) FROM table name) AS E(RN) WHERE RN > 1
DELETE FROM (SELECT ROWNUMBER() OVER (PARTITION BY b) FROM abc) AS E(RN) WHERE RN > 1