Error single row sub query returns more than one column.

  • select x.comments Email from ADDR.VW_BROWSE_PHONE x

    where x.comments in (decode((select s.COMMENTS FROM CIRC.SUBS_BILL_TO p, CIRC_RPT.VW_SUBS_INFO t, ADDR.VW_BROWSE_PHONE s

    where p.ACCOUNT = t.ACCOUNT and s.BROWSE_ID = p.BROWSE_ID and s.PHONE_TYPE = 'E' and t.BILL_TO_ENTITY_TYPE is not NULL),

    NULL,

    (select s.COMMENTS FROM CIRC.SUBS_BILL_TO p, CIRC_RPT.VW_SUBS_INFO t, ADDR.VW_BROWSE_PHONE s

    where p.ACCOUNT = t.ACCOUNT and s.BROWSE_ID = t.BROWSE_ID and s.PHONE_TYPE = 'E' and t.BILL_TO_ENTITY_TYPE is not NULL),

    (select s.COMMENTS FROM CIRC.SUBS_BILL_TO p, CIRC_RPT.VW_SUBS_INFO t, ADDR.VW_BROWSE_PHONE s

    where p.ACCOUNT = t.ACCOUNT and s.BROWSE_ID = p.BROWSE_ID and s.PHONE_TYPE = 'E' and t.BILL_TO_ENTITY_TYPE is not NULL)))

  • single row sub query returns more than one column

    mmmhhh... I think message says "more than one row", isn't it?

    If that's the case, that's exaclty what it is happening - check the line Oracle is pointing at in your script, that query is returning more than one row when it is supposed to return a single row.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • DECODE and almost the same query triple times in it ? You are doing something horribly whong here. Try to do it with just one query and DECODE within it.

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths
  • As stated above you are returning more than one row.

    You need to reconstruct your query to return one row.

    Try using using an Operator that restricts the result set.

    http://www.dba-oracle.com/t_ora_01427_single_row_subquery_returns_more_than_one_row.htm

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply