2017-08-17 7 views
-1

次のSQLで重複した結果を削除するにはどうすればよいですか?SQLで重複を削除する方法

SELECT * 
FROM  fccestimatedcustomer LEFT JOIN fcccustomerregistration 
ON  fccestimatedcustomer.CustomerRegistrationRefID = 
      fcccustomerregistration.CustomerRegistrationRefID 
WHERE  fccestimatedcustomer.Status = 1 
ORDER BY VehicleNumber ASC; 
+3

は 'distinct'グーグル、あなたのfccestimatedcustomerのいくつかの例のデータを投稿、this.Ifない作品をお試しください。 –

+0

あなたの現在の結果を表示して、重複を削除したいものを教えてください – Sinto

+0

今日のヒント:テーブルエイリアス! – jarlh

答えて

0

最も簡単な方法は、あなたがこの選択をしたいと思っているに指定したフィールドでDISTINCTを使用することです。

1
SELECT DISTINCT * 
FROM  fccestimatedcustomer LEFT JOIN fcccustomerregistration 
ON  fccestimatedcustomer.CustomerRegistrationRefID = 
      fcccustomerregistration.CustomerRegistrationRefID 
WHERE  fccestimatedcustomer.Status = 1 
ORDER BY VehicleNumber ASC; 

fcccustomerregistrationテーブル

関連する問題