title: Pick displayid and displayorder wherever columnname is 1 and delete it, and rearrange the display order
body: <p><a href="https://i.stack.imgur.com/SqWGi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SqWGi.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/wzdUK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wzdUK.png" alt="enter image description here"></a></p>
  
  <p>I need to pick <code>displayid</code> and <code>displayorder</code> wherever <code>columnname</code> is 1 and delete it, and rearrange the display order  </p>
  
  <p><a href="https://i.stack.imgur.com/3LMzq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3LMzq.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/dAAkg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dAAkg.png" alt="enter image description here"></a></p>
  
  <p>I've framed query to delete the <code>columnid</code> and rearrange the <code>displayorder</code> but didn't know how to traverse through <code>displayid</code> using while.?</p>