Results 1 to 3 of 3

Thread: SQL Query Error

  1. #1
    Join Date
    Oct 2007
    Posts
    10

    SQL Query Error

    I am getting an error that states single-row subquery returns more than one row:

    Unique_id and org_unit are integers

    update main_t set unit_descr = (select unit_desc from org_units, main_t
    where unit_descr is null and unique_id = org_unit)

    Please help!

    Thanks...

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Ensure your subquery returns single row.

  3. #3
    Join Date
    Jan 2008
    Posts
    1
    update main_t set unit_descr = (select unit_desc from org_units, main_t
    where unit_descr is null and unique_id = org_unit)

    In ur query above ur using = operator which takes only single value instead try using in operator. Or in subquery u can use top 1 key word according to ur requirement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •