Tuesday, August 5, 2014

Reg SQL server -this is my first question

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]signature


No comments:

Post a Comment