简体   繁体   中英

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.

My row is uniquely identified through these three fields.

Since status is a reserved keyword

Try like this

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

Keywords and Reserved Words in MySQL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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