我运行了以下查询:
select a.cust_id, a.date, b.sum1 as open_spend
from stone.monthly_data a, input1 b
where a.cust_id=b.cust_id
group by a.cust_id,a.date limit 20;
我收到以下错误: 无法识别表源中“a”、“input1”附近的输入(state=42000,code=40000)
I got the error even when I used 'AS':
select a.cust_id, a.date, b.sum1 as open_spend
from stone.monthly_data AS a, input1 b AS b
where a.cust_id=b.cust_id
group by a.cust_id,a.date limit 20;
有人可以告诉我出了什么问题吗?
最佳答案
这与别名无关,尝试为 input1 b 提供数据库名称。
还有一件事是 b.sum1 不在按条件分组中,您也可能会收到不同的错误。
关于mysql - 当我使用表名别名时运行配置单元查询时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30810443/