选择在不同日期订购的相同客户的订单

时间:2016-11-21 11:01:54

标签: mysql

我在MYSQL工作台中尝试了这个命令来选择在不同日期订购的相同客户(相同的customerID)的订单:但是它没有正常工作:错误是什么?

SELECT * FROM Table1 WHERE customerID = customerID AND shipmentDate != shipmentDate;

感谢您的支持!

1 个答案:

答案 0 :(得分:1)

SELECT * FROM Table T1,TABLE T2 WHERE T1.customerID = T2.customerID AND T1.shipmentDate <> T2.shipmentDate;