title: MYSQL - Update using while loop
body: <pre><code>declare c int 
  set c = 1
  while c&lt;700 do
  update users set profile_display_name = concat(substring(first_name,1,1), last_name) 
          where profile_display_name is null and id between ((c-1)*10000+1) and (c*10000);
  SET c = c+1;
  End while ;
  </code></pre>
  <p>I am getting error. near declare and end while statement. Where am I making mistake??</p>