SQL查询语法错误
我在此查询中遇到语法错误,但我不知道我做错了什么。
UPDATE `jos_planning2_rosters` r
LEFT JOIN jos_planning2_rosters_setup s ON r.id = s.roster_id
LEFT JOIN jos_planning2_workplaces w ON s.workplace_id = w.id
WHERE r.roster_state =1
AND s.card_id IS NULL
AND s.type_id = '2'
AND r.roster_date >= DATE( NOW()) SET s.card_id = '1', s.type_id = '1'
WHERE s.type_id = '2', s.card_id IS NULL, r.id = '8';
I got a syntax error on this query, but I don't know what I'm doing wrong.
UPDATE `jos_planning2_rosters` r
LEFT JOIN jos_planning2_rosters_setup s ON r.id = s.roster_id
LEFT JOIN jos_planning2_workplaces w ON s.workplace_id = w.id
WHERE r.roster_state =1
AND s.card_id IS NULL
AND s.type_id = '2'
AND r.roster_date >= DATE( NOW()) SET s.card_id = '1', s.type_id = '1'
WHERE s.type_id = '2', s.card_id IS NULL, r.id = '8';
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的查询中有两个
WHERE
子句。You have two
WHERE
clauses in your query.您是否尝试这样做,查询一团糟:
Are you trying to do this, the query is a mess:
尝试一下,不要在
jos_planning2_rosters
周围添加反引号。Try it without those backticks around
jos_planning2_rosters
.