2
我将一个表中的记录插入状态为主导的其他记录。现在有两个表中的列数是不同的,我必须使用字段名称。然而它的失败。不知道在哪里的原因是在选择值时查询失败
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'
这将work..no需要值 ---感谢
太好了。我被延迟回答同样的问题;) – Naved 2011-02-01 05:19:42