备忘--sqlserver 通过Partion取出唯一记录
select * From (Select *, ROW_NUMBER() OVER(Partition by HWGDID Order by Last_transaction desc) rw
From Production.ISEEV5_V5Devices_byOOS
Where HWGDID <> 'No Value')t
Where t.rw = 1
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21634320/viewspace-774963/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/21634320/viewspace-774963/