Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL question
HI everyone!
I have 3 tables
depositor is many to many relation between customer & account
Now i want to delete customers who has account balance less than 500.00.
I tried following SQL. It work nice if there is only one customer
satisfied the condition.
If more than one customer has account balance less than 500 this didn't
work.
It says single row sub query returns multiple row.
here is my sql code
delete from customer
where
customer_id=
(
select
distinct customer_id
from
customer c join depositor d using(customer_id) join account a
using(account_number)
where
a.balance<500
);
Please help me.
What should i do?
Received on Sun Apr 23 2006 - 23:07:26 CDT