查询重复导入的合同明细
with sc as(
SELECT sold_conts_detail_id,DETAIL_SEQ,SOLD_CONTS_NO,ITEM_CODE,ITEM_NAME,BOOK_CODE,RELATION_DETAIL_SEQ FROM MKT.T_BESO_SALES_CONTS_DETAIL WHERE BOOK_CODE='6707' AND ATTRIBUTE3='SERVICE'
)
SELECT * FROM (
SELECT * , Row_Number() OVER (partition by SOLD_CONTS_NO ORDER BY SOLD_CONTS_NO desc)NUMO FROM sc) WHERE NUMO>1 ORDER BY SOLD_CONTS_NO
with sc as( SELECT sold_conts_detail_id,DETAIL_SEQ,SOLD_CONTS_NO,ITEM_CODE,ITEM_NAME,BOOK_CODE,RELATION_DETAIL_SEQ FROM MKT.T_BESO_SALES_CONTS_DETAIL WHERE BOOK_CODE='6707' AND ATTRIBUTE3='SERVICE' ) SELECT * FROM ( SELECT * , Row_Number() OVER (partition by SOLD_CONTS_NO ORDER BY SOLD_CONTS_NO desc)NUMO FROM sc) WHERE NUMO>1 ORDER BY SOLD_CONTS_NO