ステータスがリードであるレコードに、あるテーブルから別のテーブルにレコードを挿入しています。今、私はフィールド名を使用する必要があります両方のテーブルで列の数が異なるsincce。しかし、その失敗。わからない原因は値の選択時にクエリが失敗する
INSERT IGNORE INTO Table1(
lead_id,
phone_number,
title,
first_name,
middle_initial,
last_name,
address1,
address2,
address3,
city,
state,
postal_code,
gender,
date_of_birth,
alt_phone,
email,
comments,
question_id,
answer_ques,
situation_id,
best_time_contact,
specific_datetime,
specific_datetime_at,
leadcreated_by,
leadcreated_by_on,
leadcreated_by_at,
transfer_by,
product_id,
insertDTS
)
SELECT
lead_id,
phone_number,
title,
first_name,
middle_initial,
last_name,
address1,
address2,
address3,
city,
state,
postal_code,
gender,
date_of_birth,
alt_phone,
email,
comments,
question_id,
answer_ques,
situation_id,
best_time_contact,
specific_datetime,
specific_datetime_at,
leadcreated_by,
leadcreated_by_on,
leadcreated_by_at,
transfer_by,
product_id,
insertDTS
FROM TABLE2
WHERE TABLE2.status = 'LEAD'
これは、MySQLの私の知識を1として、あなたはVALUESを使用することはできませんし、同じINSERT文でSELECT値 ---おかげ
グレート。私は同じ答えに遅れていた;) – Naved