MySQL 更新时选择
我写了一个查询,并且我确信它是正确的形式。 但我收到错误。 :) 我可以做其他查询吗?
UPDATE pages SET
p_name = 'Activites',
p_active = 1,
p_parent = 'sport',
p_parent_id=(
SELECT p_id FROM pages WHERE p_link='sport' LIMIT 1
),
p_link = 'activites'
WHERE p_id = 9;
谢谢。
I wrote a query, and Im sure that it was right form.
But I get an error. :)
May I do this query else?
UPDATE pages SET
p_name = 'Activites',
p_active = 1,
p_parent = 'sport',
p_parent_id=(
SELECT p_id FROM pages WHERE p_link='sport' LIMIT 1
),
p_link = 'activites'
WHERE p_id = 9;
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不能这样做。您需要交叉连接表和子查询:
You can't do that this way. You need to cross join the table and subquery: