if you would like to see how it works, please run this query --
Code:
SELECT AttributeName
, case when AttributeId = 3 then 0 else 1 end as sortkey1
, case when AttributeId = 4 then 0 else 1 end as sortkey2
, case when AttributeId = 2 then 0 else 1 end as sortkey3
, case when AttributeId = 1 then 0 else 1 end as sortkey4
FROM Attributes
WHERE AttributeId in ( 3, 4, 2, 1 )
order
by case when AttributeId = 3 then 0 else 1 end
, case when AttributeId = 4 then 0 else 1 end
, case when AttributeId = 2 then 0 else 1 end
, case when AttributeId = 1 then 0 else 1 end