title: MySQL query all existent and non existent entries from list (inline table)
body: <p>I have a MySQL database with a table of tag names. I have a list of tags I want to assign and need to check whether they are in the database or not. Therefore I want to write a query which gives me the ids of all tags in the list which are already present and the ones which are not present yet.</p>
  
  <p>In SQLite I already managed to write this query, but as it contains a CTE it can't directly be converted to MySQL.</p>
  
  <p>The SQLite query is:</p>
  
  <pre><code>WITH
  check_tags(name) AS ( VALUES ("name1"), ("name2) )
  SELECT check_tags.name, tags.id FROM check_tags
  LEFT JOIN tags ON check_tags.name = tags.name
  </code></pre>
  
  <p>The result would be for example:</p>
  
  <pre><code>   id   | name
     ---------------
     1    | name1
     Null | name2
  </code></pre>
  
  <p>In MySQL it could be something with <code>SELECT * FROM ( VALUES("name1), ("name2") ) ...</code> which I have seen for other database systems, but this also doesn't work with MySQL.
  All these different SQL dialects make searching for help difficult.</p>