gpt4 book ai didi

mysql - 错误 : Unknown Column in 'field list'

转载 作者:行者123 更新时间:2023-11-30 23:59:23 25 4
gpt4 key购买 nike

当列 ls.amount 在字段列表中时,我收到一个错误我运行以下查询。

任何人都可以帮助我诊断问题。

SELECT c.name, ic.keyword, COUNT(ic.keyword), SUM(ls.amount), ls.buyer FROM in_clicks AS ic
INNER JOIN ads AS a ON ic.ad_id = a.id
INNER JOIN ad_groups AS ag ON a.ad_group_id = ag.id
INNER JOIN campaigns AS c ON ag.campaign_id = c.id;
INNER JOIN leads AS l ON (ic.id = l.in_click_id)
INNER JOIN lead_status AS ls ON (l.id = ls.lead_id)
WHERE ic.create_date LIKE '%2011-08-19%' AND ic.location NOT LIKE '%Littleton%' AND discriminator LIKE '%AUTO_POST%'
GROUP BY ic.keyword ORDER BY COUNT(ic.keyword) DESC

准确的错误信息是:

Error Code: 1054
Unknown column 'ls.amount' in 'field list'

最佳答案

在第 4 行删除分号 (;)。我怀疑这会在您定义 ls 别名之前结束您的查询。

SELECT c.name,
ic.keyword,
COUNT(ic.keyword),
SUM(ls.amount),
ls.buyer
FROM in_clicks AS ic
INNER JOIN ads AS a
ON ic.ad_id = a.id
INNER JOIN ad_groups AS ag
ON a.ad_group_id = ag.id
INNER JOIN campaigns AS c
ON ag.campaign_id = c.id
INNER JOIN leads AS l
ON ( ic.id = l.in_click_id )
INNER JOIN lead_status AS ls
ON ( l.id = ls.lead_id )
WHERE ic.create_date LIKE '%2011-08-19%'
AND ic.location NOT LIKE '%Littleton%'
AND discriminator LIKE '%AUTO_POST%'
GROUP BY ic.keyword
ORDER BY COUNT(ic.keyword) DESC

关于mysql - 错误 : Unknown Column in 'field list' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7181110/

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