如何删除以下sql中的重复结果?
SELECT *
FROM fccestimatedcustomer LEFT JOIN fcccustomerregistration
ON fccestimatedcustomer.CustomerRegistrationRefID =
fcccustomerregistration.CustomerRegistrationRefID
WHERE fccestimatedcustomer.Status = 1
ORDER BY VehicleNumber ASC;
答案 0 :(得分:1)
SELECT DISTINCT *
FROM fccestimatedcustomer LEFT JOIN fcccustomerregistration
ON fccestimatedcustomer.CustomerRegistrationRefID =
fcccustomerregistration.CustomerRegistrationRefID
WHERE fccestimatedcustomer.Status = 1
ORDER BY VehicleNumber ASC;
试试这个。如果不行,请发布你的fccestimatedcustomer,fcccustomerregistration表的一些示例数据
答案 1 :(得分:0)
最简单的方法是将DISTINCT
与您希望进行此选择的指定字段一起使用。