mysql if判断字段值更新量两表数据sql

UPDATE a,b

SET ps=if(ps='0','1',ps),uptime=if(ps='0',acttime,uptime),pw=if(ps='0','123',pw)

where eo_on in(select id from b where status ='1') and a.on=b.id

posted @ 2012-05-09 12:59  小羽毛的天空  阅读(593)  评论(0编辑  收藏  举报