关于Column '' in field list is ambiguous
MySQL中的错误。如果 mysql 无法确定字段名称属于哪个表,则会导致此问题。有没有人知道为字段指定限定表名的不同方法,而不是将表名作为字段本身的前缀。假设我有一个这样的字段列表
INSERT INTO dupes
( lead_id,set_id,upload_date,agent,callcenter
,generation_date,vendors,first_name
,last_name,email,phone,address,city,state,zip,dob
,gender,marital_status,rented,year,make,model,trim
,vin,primary_use,miles_oneway,mileage,license_num,license_state
,education,job_title,license_status)
(SELECT lead_id,set_id,upload_date,agent,vendors,callcenter
,generation_date,first_name,last_name
,email,phone,address,city,state,zip,dob,gender,marital_status
,rented,year,make,model,trim,vin,primary_use,miles_oneway
,mileage,license_num,license_state,education,job_title
,license_status
FROM leads_auto
JOIN (
SELECT vendors, email, MIN(lead_id) min_lead_id
FROM leads_auto
WHERE vendors = 1762
GROUP BY vendors, email) y
ON y.vendors = leads_auto.vendors
AND y.email = leads_auto.email
AND leads_auto.lead_id <> y.min_lead_id)
现在我正在考虑使用GROUP_CONCAT([fields] SEPARATOR ',[table name].')
将字段添加到变量中,然后执行它。还有其他人有什么想法吗?