title: Using @variables MySQL in Sequelize
body: <p>I'm trying to get a iterator from MySQL (Sequelize Raw Query), using SET variables, as follows:</p>
  
  <p><code>SET @Variable:=0;
  SELECT @Variable:=@Variable+1 AS AddNewColumn</code></p>
  
  <p>My specific code is:</p>
  
  <p><code>SET @i = 0;
      SELECT
      @i:=@i+1 AS iterator,
      COUNT(ci.id) totalCases,
  ...
  </code></p>
  
  <p>But throws the following error:</p>
  
  <p><code>'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 \'SELECT\n    @i:=@i+1 AS iterator,\n    COUNT(ci.id) totalCases,\n    SUM(b_p.amount\' at line 2',</code></p>
  
  <p>Any idea?</p>
  
  <p>By the way, I'm using MySQL 5.7:</p>
  
  <p><code>mysql  Ver 14.14 Distrib 5.7.26, for Linux (x86_64) using  EditLine wrapper</code></p>