Q:

Updating multiple field in same table with different WHERE condition

I ask myself if it is possible to update 2 field in 1 table but using 2 different where conditions.  let me explain it.  currently i am using 2 query like this: 
UPDATE members SET last_game = $time WHERE userid = 1

UPDATE members SET game_played = game_played + 1 WHERE userid > 0

i wonder if there is a way to join these 2 query in sql ? 

A:

You can use a CASE expression:
UPDATE members 
SET 
   last_game = CASE WHEN userid = 1 THEN $time ELSE last_game END,
   game_played = game_played + 1 
WHERE userid > 0

