I have a table which contains data use Sql server 2008 r2
+-----+------+--------+-------+------+-------+
| 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 |
+-----+------+--------+-------+------+-------+
How can I get this result?
+-----+------+--------+-------+------+-------+
| ID | Kind | Date | Price | Type | Amount|
+-----+------+--------+-------+------+-------+
| 525 | 32 |1/1/2016| 240 | 0 | 3000 |
| 525 | 32 |1/1/2016| 380 | 1 | 4000 |
+-----+------+--------+-------+------+-------+
答案 0 :(得分:0)
这不会吗?
SELECT DISTNCT ID, Kind, Date, Price, Type, Amount FROM dbo.yourTable