title: Node - subquery in mysql insert
body: <p>I'm using the <a href="https://github.com/mysqljs/mysql" rel="nofollow noreferrer"><code>https://github.com/mysqljs/mysql</code></a> library.</p>
  
  <p>How can I do an <code>INSERT</code> with a subquery?</p>
  
  <p>For example:</p>
  
  <pre><code>connection.query(
      INSERT INTO foods (name,category) VALUES (?,?)`,
      [
         `pizza`, 
         `SELECT id FROM categories WHERE name = 'italian'`
      ]
  )
  </code></pre>