以下查詢嵌套子查詢中選擇記錄給我無效的標識符錯誤(a.id),因爲它裏面嵌套子查詢:使用ROWNUM在Oracle中導致無效的標識符錯誤
SELECT a.*,
CASE WHEN
SELECT id FROM (SELECT id, ROWNUM rnum FROM US b WHERE b.id = a.id ORDER BY b.createdate ASC) WHERE rnum = 2) = 21 THEN ‘Found’
END SEARCH
FROM EU a
JOIN US b ON b.id = a.id;
任何人都可以給我建議另一種方法?