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

    A subquery returns more than 1 row while only one row was expected.


    Either check that the data that is returned is correct, change the subquery so it returns maximum one row or allow more rows to be returned.


    In following example 2 rows matches the where condition. This will result in above error message.

    By changing the condition to use a IN relation operator, we prevent the error from being generated.


    SQL> create table srs(n number);

    Table created.

    SQL> insert into srs values(1);

    1 row created.

    SQL> /

    1 row created.

    SQL> select * from srs where n = (select n from srs where n=1);
    select * from srs where n = (select n from srs where n=1)
    *
    ERROR at line 1:
    ORA-01427: single-row subquery returns more than one row


    SQL> select * from srs where n in (select n from srs where n=1);

    N
    ----------
    1
    1

Adverteren bij Daisycon
Forum Messages
23-FEB-2008 01:55:21faceing problem of update multiple rowsPrateek Mathur Reply
query are :

update domst020 b set acct_int_paid_bal = (select sum(cert_int_paid_bal)
from domst040 d,domst020 c
where d.cert_subsys_cd=c.acct_subsys_cd and d.cert_ac_no=c.acct_ac_no
and d.cert_int_paid_bal >0 and d.CERT_SUBSYS_CD=b.acct_subsys_cd group by d.cert_ac_no ) where acct_subsys_cd='MIC';

error :
Single Row Subquery Returns More then one Row

tell me how to Update Multiple rows in Update Query in Oracle ???
: ->  24-MAR-2008 08:08:20insert querySanjay Pawar Reply
hi
iwant to insert more then one row in single statment

sanjay
02-MAY-2008 07:16:27nested queriesReshu_Ravi Reply
I have a table product. I want to narrow search based on modelname and productname. I am using my sql. Can anybody tell me how to do that. I think nested query will help me.
: ->  14-MAY-2008 08:44:21Please provide an exampleDbMotive Reply
Can you please provide an example of what you are trying to accomplish?
Add your message for ORA-01427
Name:email:
Validation Code:zi350o4rcg7rs3kt8
Enter Code above:
Title:
State your problem: