Oracle查询重复数据取第二行,好用来删除重复数据

Oracle查询重复数据取第二行,好用来删除重复数据

SELECT * FROM (

SELECT e.* ,

ROW_NUMBER() over(PARTITION BY product_category_id,model_size_id ORDER BY product_category_id,model_size_id) rn

FROM equ_check_rules e ) s WHERE rn = 2;

你可能感兴趣的:(sql,mysql,数据库)