Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005

    Unanswered: How to update with the same value

    I am trying to update and
    (select ....);

    and in my select returns more than 1 rows(MSGubquery returns more than 1 rows).
    For example if there are more than one same value in a cell that matches with select (4,4,4,4,4,4,4...) i want to put only the '4' in the value and not all the 4's!Thats why it hits an error but i dont know how to put only one of the same values in the cell.
    Any idea?

  2. #2
    Join Date
    Oct 2004
    Use limit statement in your subquery to select the first record alone


    UPDATE <tablename>
    SET <colname> = (SELECT <colname> FROM <tablename> LIMIT 1);

Posting Permissions

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