SQL Language (MOSC)

MOSC Banner

eSQL Case is throwing ORA-01427

edited Apr 10, 2020 5:00AM in SQL Language (MOSC) 3 commentsAnswered

Hi

I have a query which is throwing ORA-01427 at CASE. I am looking for a fix or alternate for this.

eg.,

SQL> select ename,case deptno when 20 then ( select dname from scott.dept where deptno=deptno )

when 10 then ( select distinct dname from scott.dept where deptno=deptno ) end from scott.emp;

select ename,case deptno when 20 then ( select dname from scott.dept where deptno=deptno )

*

ERROR at line 1:

ORA-01427: single-row subquery returns more than one row

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center