By the way, if you dont want to filter only flag=1 then you can use this:
select flag, 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, flag
[Personal Site] [Blog] [Facebook]
No comments:
Post a Comment