Tuesday, August 5, 2014

Reg SQL server -this is my first question

Thanks saravanan..excellent it worked...



select min(iccid),max(iccid)
from (
select * , convert(bigint,iccid) - ROW_NUMBER() over (partition by flag order by iccid) RN
from club_values
where flag =1
) T
group by RN

No comments:

Post a Comment