日期:2014-05-17 浏览次数:20496 次
WITH huang ( 单号, ID )
AS ( SELECT '6921109062192' ,
'H123456'
UNION ALL
SELECT '6921109062192' ,
'H123456'
UNION ALL
SELECT '6921109062321' ,
'FW082679020506'
UNION ALL
SELECT '6921109062321' ,
'FW072490010006'
),
huang2
AS ( SELECT ROW_NUMBER() OVER ( PARTITION BY 单号, ID ORDER BY 单号 ) rid ,
*
FROM huang
)
SELECT *
FROM huang2
WHERE rid > 1