36
Views
6
Comments
How do I go about returning a single-row subquery that has more than 1 row
Application Type
Reactive
Service Studio Version
11.54.56 (Build 63232)

Some background information on how I got to this issue. I'm using an aggregate to return back to me a list of Applicants. Keep in mind, when the list is being returned it has to also look for another row that has a boolean value of True or False. When I enter in my test values I get an error back saying:

Error executing query. ORA-01427: single-row subquery returns more than one row.

I'm unable to share what I have regarding data but is there a way around this.

2019-01-07 16-04-16
Siya
 
MVP

I'm not sure if the community can assist without additional details. If allowed, consider sharing the SQL query generated by the aggregate. 

The error 'ORA-01427: single-row subquery returns more than one row' occurs when a subquery used in an SQL statement returns more than one row, but is expected to return exactly one row and one column. To resolve this error, ensure that your subquery returns only one row.

UserImage.jpg
Akeem Heshimu

Is there an example of returning a subquery with only 1 row that you can show me, by using an aggregate. 

2019-01-07 16-04-16
Siya
 
MVP

Sorry, I don't have an example using aggregates. However, for similar requirements, I typically use advanced queries. When encountering the 'single-row subquery returns more than one row' issue, I often limit the records using aggregate functions like MAX(), MIN(), AVG(), or DISTINCT.

UserImage.jpg
Akeem Heshimu

Do you have an example using the SQL widget?

2019-01-07 16-04-16
Siya
 
MVP

You will find examples of these in internet. Let's focus on resolving the issues that you are facing.

UserImage.jpg
Alexandre Yip

Hi Akeem Heshimu, 

You can change the tablenames and fields names and paste here the SQL query in order to help you better, if possible. 

Regards 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.