日期:2014-05-16 浏览次数:21012 次
WITH ta AS
(SELECT 20 a FROM dual UNION ALL
SELECT 20 a FROM dual UNION ALL
SELECT 21 a FROM dual UNION ALL
SELECT 25 a FROM dual UNION ALL
SELECT 10 a FROM dual UNION ALL
SELECT 21 a FROM dual
)
SELECT A,
DECODE(ROW_NUMBER() OVER(PARTITION BY A ORDER BY ROWNUM),
1,
'Y',
'N')
FROM TA
ORDER BY ROWNUM