错误代码:1054。“on clause”错误代码:1054.“on子句”中的未知列's.Product_id'

时间:2017-08-04 01:09:46

标签: mysql mysql-error-1054

我在MySQL中遇到错误:Error Code: 1054. Unknown column 's.Product_id' in 'on clause'

出现在:

SELECT c.customer_ID, p.Product_id, p.Product_price, s.Items_quantity, (p.Product_price * s.Items_quantity) AS total FROM Products p LEFT JOIN Shopping_list s ON p.Product_id = s.Product_id LEFT JOIN Customer_sign_in c ON c.customer_ID = s.customer_ID LIMIT 0, 50000

有没有人知道为什么会这样?

3 个答案:

答案 0 :(得分:1)

你应该使用LEFT JOIN

select c.customer_ID, p.Product_id, p.Product_price, s.Items_quantity,
    (p.Product_price * s.Items_quantity) as total from Products p LEFT JOIN Shopping_list s ON p.Product_id = s.Product_id LEFT JOIN Customer_sign_in c ON c.customer_ID = s.customer_ID;

答案 1 :(得分:0)

您确定其中包含表格Shopping_list和名为Product_id的列吗?

如果您没有,请创建该列并重试。

答案 2 :(得分:0)

curl https://api.box.com/2.0/files/207843785204/metadata/global/properties -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json-patch+json" -d '[{"op": "add", "path": "/Hi", "value": "no"}]' -X PUT