I have a problem with NVL function.I can use my in clause properyl but when i add nvl it gives error.
My query like this:
SELECT ci.date,
SUM (cid.salary) amount, SUM (cid.slary_gross) gross_amount
FROM students ci,
orders cid
WHERE
ci.id IN NVL((select id from sysadm.students
where status = 'IN' AND student_id= 24514 ORDER BY id
FETCH FIRST 3 ROWS ONLY), ci.id )
My error: 01427. 00000 - "single-row subquery returns more than one row"
?f I delete nvl function and just write like below it is running.How can i use nvl with in clause?
ci.id IN (select id from sysadm.students where status = 'IN' AND student_id= 24514 ORDER BY id FETCH FIRST 3 ROWS ONLY)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…