gpt4 book ai didi

mysql - 获取mysql错误1054

转载 作者:搜寻专家 更新时间:2023-10-30 20:00:16 24 4
gpt4 key购买 nike

我收到此错误:#1054 - “on 子句”中的未知列“t.mobile”

SELECT t.*,v.name,v.contact_person_email,l.firstname as memname 
FROM transactions t , vendor v
LEFT JOIN loyalty_members l ON (t.mobile=l.mobile)
WHERE t.vendor_id ='N1WU95'
AND v.alert_mail = '2'
AND t.add_date <= '2011-07-22 09:00:00'
AND t.add_date >= '2011-07-21 09:00:00'
AND t.vendor_id = v.id
AND t.type = '1'
AND t.deleted != '1'
AND t.reference_id = '0'
GROUP BY t.mobile
HAVING COUNT(t.mobile) > 1;

谁能帮我解决这个问题?

谢谢。

最佳答案

尝试:

   SELECT t.*, v.name, v.contact_person_email, l.firstname memname 
FROM vendor v, transactions t
LEFT JOIN loyalty_members l ON t.mobile = l.mobile
WHERE t.vendor_id ='N1WU95'
AND v.alert_mail = '2'
AND t.add_date <= '2011-07-22 09:00:00'
AND t.add_date >= '2011-07-21 09:00:00'
AND t.vendor_id = v.id
AND t.type = '1'
AND t.deleted != '1'
AND t.reference_id = '0'
GROUP BY t.mobile
HAVING COUNT(t.mobile) > 1;

您正在使用错误的表序列执行 LEFT JOIN。引擎试图将 vendor 表与 loyalty_members 表连接起来。

关于mysql - 获取mysql错误1054,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6789293/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com