Einzelnen Beitrag anzeigen

Medium

Registriert seit: 23. Jan 2008
3.679 Beiträge
 
Delphi 2007 Enterprise
 
#2

AW: [MySQL] Multiple-Row-Update

  Alt 20. Jul 2011, 11:51
Okay, selbst drauf gekommen. Letztlich simpel:
Code:
UPDATE `mytable` SET
   `color` = CASE id
     WHEN 2 THEN 255 
     ELSE `color`
   END,
   `position` = CASE id
     WHEN 1 THEN 5 
     ELSE `position`
   END
Sorry!
"When one person suffers from a delusion, it is called insanity. When a million people suffer from a delusion, it is called religion." (Richard Dawkins)
  Mit Zitat antworten Zitat