关于MYSQL 的UPDATE 请求帮助

来源:百度知道 编辑:UC知道 时间:2024/06/25 07:33:04
我有一个数据表..要用UPDATE 来更新一下..但又要同时用两个判断..

就是不会!!

一个判断更新是这样的
update t_char set t_char.charname='123' where charguid='123456'
是判断charguid 这个的IP... 那我现在要增加一个判断pid 的..请问这语句应该怎么弄?

update t_char set t_char.charname='123' where charguid='123456' and pid ='****'

不知道这是不是你想要的结果。

update t_char set t_char.charname='123' where charguid='123456' and pid='数据'

两个条件同时满足的话:
update t_char set t_char.charname='123' where charguid='123456' and pid='条件'
二者选其一的话:
update t_char set t_char.charname='123' where charguid='123456' or pid='条件'