MYSQL-update与select结合使用

Posted 悟空的爸爸

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MYSQL-update与select结合使用相关的知识,希望对你有一定的参考价值。

使用 inner join

 

update picture inner join (select iteration+1 as i from picture where pic_id=453) c set labels="56,57,58" , iteration=c.i where pic_id=453;

 

如上例子:

完成更新  picture.labels 字段 & picture.iteration自增 的两个功能。

以上是关于MYSQL-update与select结合使用的主要内容,如果未能解决你的问题,请参考以下文章