title: How to use User-Defined Variables in the limit statement?
body: <p>I want a paging query in common format, not hard code, by this:</p>
  
  <pre><code>set @pageSize = 10; set @pageIndex = 2;
  
  select * from city LIMIT (@pageIndex-1)*@pageSize, @pageSize;
  </code></pre>
  
  <p>but the mysql told me that:</p>
  
  <blockquote>
    <p>[Err] 1064 - You have an error in your SQL syntax; check the manual
    that corresponds to your MySQL server version for the right syntax to
    use near '(@pageIndex-1)*@pageSize, @pageSize' at line 1</p>
  </blockquote>
  
  <p>what's the problem about this?</p>