title: SQL: A column in a subquery does not appear
body: <p>There is a query in MySQL 5.7:</p>
  <pre><code>SELECT * FROM
  (
  SELECT (@rowNum:=@rowNum+1) AS rowNo,t.* FROM table_target t,(SELECT (@rowNum :=0)) AS b 
  WHERE p_d = '2020-11-08' 
  ORDER BY kills DESC
  ) t
  WHERE t.uid= '8888'
  </code></pre>
  <p>Running this query, there is no exception but column B disappears and if using <code>select b from</code> in the outter query, it returns <code>unknown column</code> exception.</p>
  <p>I have 2 questions:</p>
  <ol>
  <li>Why the <code>(SELECT (@rowNum :=0))</code> does not appear?</li>
  <li>Is the <code>(@rowNum:=@rowNum+1)</code> equivelent to <code>row_number() over ()</code> in Oracle? If so, how to understand it...</li>
  </ol>
  <p>Thanks for your help in advance.</p>
  <p>In addition, I just found if I put the <code>(SELECT (@rowNum :=0) )</code> in the left:</p>
  <pre><code>...
  SELECT (SELECT (@rowNum :=0) ) AS b, (@rowNum:=@rowNum+1) AS rowNo , t.* FROM table_target t
  ...
  </code></pre>
  <p>Then the row number column does not increase any more, why could this happen?</p>