SQL:加入隐含的错误,但我认为这是在SELECT语句中,想法?

时间:2017-03-20 03:26:39

标签: mysql sql select right-join

SELECT customer_id,        付款,        SUM(支付) 来自telemon_payments_data付款 LEFT JOIN telemon_customer_data客户 ON payments.customer_id = customer.customer_id GROUP BY 1 在2016-01-01和2016-01-31之间有customer.account_created_on

+++++++++++

显然,我的customer_id字段是ambigious,因为这是错误代码。思考?谢谢!

2 个答案:

答案 0 :(得分:0)

正如Mitch Wheat所说,问题在于你的第二张桌子中的空间

使用January Cohort AS January

或[January Cohort] AS January

答案 1 :(得分:0)

模糊的$(function() { $('form').submit(function(e) { e.preventDefault(); var data = $('input[name="telefon"]').val(); if(data.length > 0) { function uyem() } else { alert('Input are not valid'); } }); }); 错误是因为两个表都有一个customer_id字段。您需要告诉查询从哪个表中提取列(即customer_idselect customer.customer_id)。