您可以使用row_number()over()。如:
with cte as ( Select id, Permissions row_number() over( partition by id order by LEN(Permissions) desc) as rnum from SampleTable ) Select id, Permissions from cte where rnum = 1