作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有:
INSERT INTO ItemTracking(`Item`, `Source`, `LeftSourceAt`)
SELECT `Item`, `Source`, now() FROM ItemAvailability WHERE Item = 'PA';
我想执行上述查询仅当ItemAvailability
中的ItemBeingTracked
为NULL
。
编辑:If ItemAvailability.ItemBeingTracked == NULL Then
执行上述查询。
最佳答案
我认为您只需将条件添加到WHERE
:
INSERT INTO ItemTracking(Item, `Source`, LeftSourceAt)
SELECT Item, `Source`, now()
FROM ItemAvailability
WHERE Item = 'PA' AND ItemBeingTracked IS NULL;
关于MySQL:如果另一个表中的值为 NULL,如何将值插入表中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47401230/
我是一名优秀的程序员,十分优秀!