title: MYSQL ROW_NUMBER
body: <p>I'm using row_number function to rank by partition but I'm trying to use the result of row_number in a IF statement without success.</p>
  <p>My code:</p>
  <pre><code>ROW_NUMBER() OVER (partition by wboi.ce19.store, dbn.ce19.COD, dbn.ce19.MOD ORDER by dbn.ce19.store, dbn.ce19.data, dbn.ce01.COD) AS ROW1,
  IF('ROW1' = 1, 0, 1) as TEST
  </code></pre>
  <p>But all the values in &quot;TEST&quot; column are getting 1, even if the row_number is 1.</p>
  <p>Also, I tried to make sum with the Row_number() like:</p>
  <pre><code>'ROW1' + 1 AS TEST2
  </code></pre>
  <p>But all the values is 1.</p>
  <p>So, ROW_NUMBER() function output is a number or I need to convert it to number before use it in any conditional function?</p>