title: SQL Server to MySQL query
body: <p>Friends,</p>
  
  <p>I got a piece of code I need to migrate to PHP from ASP. I'm pretty good (or I think so...) in MySQL, but not so good at SQL Server, and the previous code has no documentation.</p>
  
  <p>The query in SQL:</p>
  
  <pre><code>UPDATE tab1 SET colx = '0'
    FROM (SELECT tab1.id 
            FROM tab1 LEFT OUTER JOIN tab2 
                      ON tab1.col1 = tab2.col1 
                         AND tab2.col1 = tab1.col2 
                         AND tab1.col3 = tab2.col4
           WHERE tab2.col1 IS NULL 
                 OR tab2.col4 IS NULL
          ) AS aux1 
          INNER JOIN tab1 ON aux1.id = tab1.id;
  </code></pre>
  
  <p>I don't know this sintax in MySQL. Any hint will be welcome.</p>
  
  <p>Error message:</p>
  
  <pre><code>1064 - You have an error in your SQL syntax; check the manual that correspond to your MySQL server version for the right syntax to use near 'AS aux1 INNER JOIN tab1 ON aux1.id = tab1.id'
  </code></pre>