title: How to transform a MSSQL CTE query to MySQL?
body: <p>in my MySQL schema, I have the <code>category(id, parentid, name)</code> table</p>
  
  <p>In the MSSQL, I have that CTE query (to build a category tree from the bottom up for a supplied category ID:</p>
  
  <pre><code>with CTE (id, pid, name) 
  as
  (
      select id, parentid as pid,name
      from category
      where id = 197
        union all
          select CTE.pid as id , category.parentid as pid, category.name
          from CTE 
            inner join category 
              on category.id = CTE.pid
   )
   select * from CTE 
  </code></pre>
  
  <p>How to 'transform' that query to MySQL ?</p>