declare @tablea table (id int,[type] int,number int,area int,[power] int) insert into @tablea select 1,1,23,78,98 union all select 2,2,56,27,67 union all select 3,3,21,34,23 union all select 4,4,34,22,21 union all select 5,5,76,23,11