declare @t table(id int)
insert into @t(id)
select 0
union all select 0
union all select 0
union all select 1
union all select 0
union all select 3
union all select 0
union all select 2
union all select 7
union all select 5
union all select 0
union all select 4
union all select 6
select id from @t order by case when id=0 then 99999 else id end