作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有 1 张 table
customer_assignments
具有 customer_id
和 category_id
列。
我想按 customer_id=62 一次插入多个类别 _id,例如 1,2,3 ..表格看起来像
customer_id category_id
62 1
62 2
62 3
假设如果我将 category_id
更新为 customer_id=62
,例如 1,2,表格看起来就像这样
customer_id category_id
62 1
62 2
插入和更新都会同时发生......我是 mysql 新手
我需要查询...
最佳答案
使用 2 个查询1.从客户分配中删除 *2.然后现在使用 INSERT 查询插入您想要的内容
关于mysql - 如何一次插入和更新多个值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21899072/
我是一名优秀的程序员,十分优秀!