Hi There...
need query for the following ...
Sample table script
create table #sample (id int identity ,value int)
insert into #sample values (3)
insert into #sample values (34)
insert into #sample values (21)
insert into #sample values (3)
insert into #sample values (61)