这是我的表
kwh p1 p2 p3 period
2 0 0 0 201408
15 0 0 0 201408
25 0 0 0 201408
我想用这个条件更新p1.p2.p3
UPDATE t.mytable
SET
c.p1 = if (c.kwh <= 10,c.kwh * 1600,c.p1),
c.p2 = if (c.kwh <= 20,c.kwh * 2285,c.p2),
c.p3 = if (c.kwh => 21,c.kwh - 20 * 3195,p.3),
WHERE
c.period = '082015'
请帮助