I have the script below. It only prints out one value, PLGG not all of them.
Pot
ABC
MPOT
NVPN
PLGG
However when I remove the order by case section then it prints all of the values. Why is that? Is it no possible to use a custom order by here?
declare @pot nvarchar(max) = ''
select @pot = @pot + QUOTENAME(pot) + ','
from myTbl
group by pot
order by case when pot = 'MPot' then '1'
else pot end
print(@pot)