【发布时间】:2021-01-10 18:21:15
【问题描述】:
我有这张桌子scan:
id ip port text
-----------------------------
1 192.168.0.1 2 text1
2 192.168.0.1 2 text2
3 192.168.0.1 2 text3
4 192.168.0.3 2 text4
我想通过 ip+port by last id 选择但忽略重复,所以结果将是
4, 192.168.0.3,2, text4
3, 192.168.0.1,2, text3
如何使用 T-SQL 查询做到这一点?
【问题讨论】:
标签: sql-server tsql distinct