我正在使用测试一些SQL查询,下面的查询被称为“语法不正确”,“”,这是“image_uuid”后面的逗号。我阅读了语法,我认为我列出了正确的列。
我需要将行从一个表移动到一个归档表。我将使用这个语句,然后删除我移动的行。如果有更干净的方法,请解释我还能做些什么。谢谢!
INSERT INTO litmus_mailing_archive(image_uuid, server_id, list_id, mailing_id,
litmus_job_id, email_subject, test_email_message_id,
test_running, test_started, test_finished,
ended_with_error, images_purged, notification_email)
SELECT
(image_uuid, server_id, list_id, mailing_id,
litmus_job_id, email_subject, test_email_message_id,
test_running, test_started, test_finished,
ended_with_error, images_purged, notification_email)
FROM
litmus_mailing
WHERE
server_id = ?
AND list_id = ?
AND mailing_id = ?
AND test_running = 'false'; 问号只是信息的占位符。当我测试它时,我会插入litmus_mailing中的实际数据。
发布于 2016-03-11 20:53:09
从select查询中删除括号:
SELECT (image_uuid, server_id, list_id, mailing_id,
litmus_job_id, email_subject, test_email_message_id,
test_running, test_started, test_finished, ended_with_error,
images_purged, notification_email)将其更改为:
SELECT image_uuid, server_id, list_id, mailing_id,
litmus_job_id, email_subject, test_email_message_id,
test_running, test_started, test_finished,
ended_with_error, images_purged, notification_email发布于 2016-03-11 20:53:40
删除SELECT字段列表周围的括号。
https://stackoverflow.com/questions/35949650
复制相似问题