简体   繁体   English

MySql:如何通过检查where子句中的多个字段来更新表的列?

[英]MySql : How to update column of table by checking for multiple fields in where clause?

I tried this way 我这样尝试

update message set status='Accepted' where tid=' ' and ltime=' ' and ldate=' ';

But it shows error in syntax. 但是它显示语法error

My row is uniquely identified through these three fields. 通过这三个字段可以唯一地标识我的行。

Since status is a reserved keyword 由于状态reserved keyword

Try like this 这样尝试

update message 
set `status`='Accepted' 
where tid=' ' and ltime=' ' and ldate=' ';

Keywords and Reserved Words in MySQL MySQL中的关键字和保留字

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

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