请帮我纠正语法
UPDATE
user_shift_test
SET
shifttime='01:00-21:00'
FROM
user_shift_test
INNER JOIN swaps
ON
user_shift_test.userid=swaps.csrid
WHERE
user_shift_test.userid=5
此错误正在
1064 - 您的SQL语法出错;检查与MySQL服务器版本对应的手册,以获得正确的语法 near' FROM user_shift_test INNER JOIN交换ON user_shift_test.useri' 在第5行
答案 0 :(得分:2)
UPDATE user_shift_test
SET shifttime='01:00-21:00'
WHERE userid IN
(SELECT user_shift_test.userid
FROM user_shift_test
JOIN swaps ON swaps.csrid=user_shift_test.userid
WHERE
user_shift_test.userid=5
);
答案 1 :(得分:1)
试试这个:
UPDATE user_shift_test
INNER JOIN swaps
ON user_shift_test.userid=swaps.csrid and user_shift_test.userid=5
SET shifttime='01:00-21:00'
(我假设您正尝试使用JOIN进行更新查询)
答案 2 :(得分:-2)
这应该做到
let groupedResults = _.groupBy(results, (result) => moment(result['Date'], 'DD/MM/YYYY').startOf('isoWeek'));