更新查询不起作用?

发布于 2024-09-13 11:42:19 字数 513 浏览 3 评论 0原文

这些是我的表格结构

tblcomment
- - - - - - - - - - - - -
评论id
内容_id
用户 ID
图片_id
评论
comment_time

tbl图片
- - - - - - - - - - - - -
内容_id
标题
picture_id

我正在尝试使用此更新图片上的 content_id 字段,但它似乎不起作用?

UPDATE `comments`
SET 
comments.content_id = pictures.content_id
WHERE
comments.picture_id = pictures.picture_id

我收到此错误

1054 - “where 子句”中的未知列“pictures.picture_id”

These are my table structures

tblcomment
- - - - - - - - - - - - -
comment_id
content_id
user_id
picture_id
comment
comment_time

tblpictures
- - - - - - - - - - - - -
content_id
title
picture_id

I am trying to update the content_id field on pictures using this but it doesnt seem to work ?

UPDATE `comments`
SET 
comments.content_id = pictures.content_id
WHERE
comments.picture_id = pictures.picture_id

I get this error

1054 - Unknown column 'pictures.picture_id' in 'where clause'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

转身泪倾城 2024-09-20 11:42:19

更新评论、图片集...

UPDATE comments, pictures SET ...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文