![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MySql
鹏鹏博客
不念过往
不畏将来
把握现在
携梦前行
展开
-
mysql中You can't specify target table <tbl> for update in FROM clause报错
mysql中You can't specify target table <tbl> for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表(在同一语句中)。 例如下面这个sql:delete from tbl where id in( select max(id) from tbl a where E...转载 2018-06-29 10:17:32 · 152 阅读 · 0 评论 -
通过Mysql数据库的函数获取不重复的自增值
1.创建一个储值表:存储每次自增后的最新值,用于读取 CREATE TABLE `sequence` ( `name` VARCHAR(50) NOT NULL, //自增名 `current_value` INT(11) NOT NULL, //自增的最新值 `increment` INT(11) NOT NULL DEFAULT '1' //每次的...原创 2019-05-23 10:04:06 · 460 阅读 · 0 评论