Skip to content
Advertisement

sql query with a case when returning more than one row

I’m trying to do a query with a case when condition to see what list I will show but I’m having this error ORA-01427: single-row subquery returns more than one row.

the query is this:

is it possible to call a query with more than one row inside a case condition?

Advertisement

Answer

I would do this in multiple steps. Get the action type, then issue the appropriate query. Whether you have this logic at the front end or in a stored procedure is up you and probably depends on a lot of other things.

If you absolutely needed to do it this way, then you could try something like this:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement