日期:2014-05-17 浏览次数:21094 次
WITH T AS
(SELECT 1 ID, 'a' CONT
FROM DUAL
UNION ALL
SELECT 2 ID, 'aa' CONT
FROM DUAL
UNION ALL
SELECT 3 ID, 'b' CONT
FROM DUAL
UNION ALL
SELECT 4 ID, 'c' CONT
FROM DUAL
UNION ALL
SELECT 5 ID, 'd' CONT
FROM DUAL
UNION ALL
SELECT 6 ID, 'ae' CONT
FROM DUAL)
SELECT T3.*
FROM (SELECT T.*, ROUND(ROWNUM / 2) RN FROM T) T3,
(SELECT T2.RN
FROM (SELECT T1.*, ROUND(ROWNUM / 2) RN FROM T T1) T2
WHERE T2.ID = 6) T4
WHERE T3.RN = T4.RN;