Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2006
    Posts
    1

    Red face Unanswered: How to Update identical row's field

    Hi,

    I hve two identical rows in a table. I would to update the first row's one of the field to other value. How can I do it in a SQL statement ? Pls help.

    Best Regards,
    Jason

  2. #2
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    create table foo (x int)
    go
    insert foo values(1)
    go 2
    set rowcount 1
    update foo
    set x = 2
    where x=1
    go
    (1 row affected)
    set rowcount 0

Posting Permissions

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