我正在使用SQL Server Management Studio测试一些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
。
从选择查询中删除括号:
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
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句