#1
  1. #2
  2. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,120
    Rep Power
    4274
    Code:
    UPDATE scores t1
      JOIN scores t2
        ON FIND_IN_SET(t1.id, t2.vals)
       SET t1.private = t1.private+1
         , t1.regional = CASE WHEN procType = 3 
                              THEN t1.regional+1
                              ELSE t1.regional END
         , t1.otherCol = CASE WHEN procType = 4 
                              THEN t1.otherCol+1
                              ELSE t1.otherCol END
     WHERE t2.id = procId
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo