当我转向运行以下查询时,我收到ORA-01427: single-row subquery returns more than one row
错误,不知道如何解决此问题?或者你认为我可能必须写一个游标来克服这个问题?请帮忙!
SLECT DISTINCT J.NAME
FROM Q_jobs j, xx_po x
WHERE j.name IN
CASE
WHEN x.name IS NOT NULL THEN
(select name from xx_po)
ELSE
(SELECT DISTINCT j.name
FROM per_jobs
WHERE j.name not LIKE '%Des%')
END
ORDER BY J.NAME
答案 0 :(得分:1)
试试这个)
SELECT DISTINCT J.NAME
FROM Q_jobs j, xx_po x
WHERE (x.name IS NOT NULL and j.name IN (select name from xx_po))
or (x.name IS NULL and j.name IN (
SELECT DISTINCT j.name
FROM per_jobs
WHERE j.name not LIKE '%Des%'))
ORDER BY J.NAME