Skip to content
Advertisement

How to fix Ora-01427 single-row subquery returns more than one row error?

I have query like this and it gives me single-row subquery returns more than one row error:

Which tries to get count of distinct PERSONNEL_ID from customers table where CUSTOMER_ID at customers table and CUSTOMER_ID at transactions table are equal

Can you tell me how to fix my query?

Advertisement

Answer

You have more than one customer in transactions. Presumably, you intend:

Which you can also phrase as:

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