2016-04-25 21 views
-1

ich eine Tabelle, die Daten verwenden SQL Server 2008 R2 enthältSQLServer Distinct Zeilen

+-----+------+--------+-------+------+-------+ 
| ID | Kind | Date | Price | Type | Amount| 
+-----+------+--------+-------+------+-------+ 
| 525 | 32 |1/1/2016| 240 | 0 | 3000 | 
| 525 | 32 |1/1/2016| 380 | 1 | 3000 | 
| 525 | 32 |1/1/2016| 240 | 0 | 4000 | 
| 525 | 32 |1/1/2016| 380 | 1 | 4000 | 
+-----+------+--------+-------+------+-------+ 

Wie kann ich dieses Ergebnis zu erhalten?

+-----+------+--------+-------+------+-------+ 
| ID | Kind | Date | Price | Type | Amount| 
+-----+------+--------+-------+------+-------+ 
| 525 | 32 |1/1/2016| 240 | 0 | 3000 | 
| 525 | 32 |1/1/2016| 380 | 1 | 4000 | 
+-----+------+--------+-------+------+-------+ 

Antwort

0

Wird dies nicht tun?

SELECT DISTNCT ID, Kind, Date, Price, Type, Amount FROM dbo.yourTable