Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    36

    Unanswered: Updating records

    i have a total of 5 records to update. one being a summary row and the other four being 1,2,3,4 record ids. is there any way to update these 4 records w/o using 4 seperate updates???



    thanks,
    e3witt

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    It depends upon the update you are making. Are they all being updated to the same value? Are you just trying to cascade changes from the summary row? Could the logic be built into a trigger? There are may be options you could explore.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    How is the summary record identified in the table? RecordID #5?

    update tbl set field =
    case recordid
    when 1 then ...
    when 2 then ...
    when 3 then ...
    when 4 then ...
    when 5 then ...
    end
    where recordid between 1 and 5
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

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