我在使用更新查询的SET
时遇到麻烦。我想查询另一个表,如果该表为null,则返回一个新的时间。这是代码,但不返回任何内容。没有任何错误。
SET
sched.Start= case when (SELECT employee from sched where Day=Days and shift='Pm' and store = Stores and job='Driver') is null then '2018-01-01 16:00:00' else '2018-01-01 17:00:00' end
如果我在单独的查询中运行select,它能工作吗?
select case when (SELECT employee from sched where Day='Thu' and shift='Pm' and store = 2284 and job='Pm Bread') is null then '2018-01-01 16:00:00' else '2018-01-01 17:00:00' end
答案 0 :(得分:0)
您似乎错过了上面代码中的更新
UPDATE table_reference SET任务清单 [WHERE where_condition] [订购...] [LIMIT row_count]