mysql - 得到一个 MySQL 语法错误,不知道为什么
问题描述
我试图通过使用此命令将我的文章表中的标题和内容列中的数据从数据库复制到来自不同数据库的 wp_posts 列中的 wp_title 和 wp_content 列。
INSERT INTO wp_seetheuniverse.dbo.wp_posts ('wp_title', 'wp_content')
SELECT 'title', 'content' FROM seetheuniverse.dbo.articles;
这是我得到的错误,不知道为什么。
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '.wp_posts ('wp_title', 'wp_content') SELECT
'title', 'content' FROM seetheuniver' at line 1
解决方案
使用以下查询:
INSERT INTO dbo.wp_posts (wp_title,wp_content) 从 dbo.articles 中选择标题、内容;
其中 dbo 是数据库名称,wp_posts 和文章是表。
推荐阅读
- powershell - 根据文件夹中的文件移动文件夹
- java - 检索 SafetyNet 令牌时出现问题:7:firebase OTP
- python - 如何检查字符串是否仅包含 Python 中字母列表中的字母
- javascript - 单击链接到新路线后,路线将保留旧路线道具值
- debugging - vscode 扩展:调试自动测试:调试器突然停止“越过”
- curl - 当 basic-auth 和 cookie-jar 不起作用时访问身份验证后的 URL
- reactjs - Framer 运动页面转换简化代码
- mysql - 从 Mysql SELECT 查询问题中过滤空行
- game-physics - 为什么我在 Phaser 中的游戏动画不起作用?
- docker - ECS Fargate 中的 Docker 容器在运行脚本时以代码 0 退出。无法运行容器以访问 /bin/sh