I have ten records having flag 1 then there serial no is like a,b,c,d,e,f,g,h,i,j.
Now suppose i set a flag equals to 0 then there sequence will change then i want a logic like that if suppose i set flag =0 or 1 it has to show sequence as a,b,c,d,e,g,f,h,i,j.