简体   繁体   English

具有多个WHERE子句的MySQL UPDATE语句

[英]MySQL UPDATE statement with multiple WHERE clauses

I am trying to execute an UPDATE statement as follows: 我正在尝试执行UPDATE语句,如下所示:

UPDATE table_name
SET goal_seq = 'xyz'
WHERE league_id = 20
AND home = 0
AND away = 0;

In trying to work out why it wasnt working I have established that you cant have multiple WHERE clauses (is that correct?) but I cant figure out how to get round it. 在试图弄清为什么它不起作用时,我已经确定您不能有多个WHERE子句(是正确的吗?),但是我无法弄清楚如何解决它。

Any help much appreciated, 任何帮助,不胜感激,

P P

you CAN have multiply conditions after WHERE statement - go to Mysql docs for more information and some examples - i believe the key table in your code is just a replacement for actual table name? 可以有后WHERE语句多重条件-到mysql的文档的详细信息和一些例子-我认为关键table中的代码仅仅是实际的表名更换? If this query doesn't work pls provide the error which server returns - without it we cannot help you. 如果此查询不起作用,请提供服务器返回的错误-没有它,我们将无法为您提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM