------解决方案--------------------
id uniqueidentifier类型的?
SQL code
select max(cast(id as varchar(40))),userid,name from Test group by userid,name
or
select id,userid,name from Test t where id=(select top 1 id from Test where t.userid=userid and t.name=name order by id desc)