title: Mysql: Create inline table within select statement?
body: <p>Is there a way in MySql to create an inline table to use for join?</p>
  
  <p>Something like:</p>
  
  <pre><code>SELECT LONG [1,2,3] as ID, VARCHAR(1) ['a','b','c'] as CONTENT
  </code></pre>
  
  <p>that would output</p>
  
  <pre><code>|  ID  |  CONTENT  |
  | LONG | VARCHAR(1)|
  +------+-----------+
  |   1  |    'a'    |
  |   2  |    'b'    |
  |   3  |    'c'    |
  </code></pre>
  
  <p>and that I could use in a join like this:</p>
  
  <pre><code>SELECT 
    MyTable.*,
    MyInlineTable.CONTENT
  FROM
    MyTable
    JOIN 
      (SELECT LONG [1,2,3] as ID, VARCHAR(1) ['a','b','c'] as CONTENT MyInlineTable)
    ON MyTable.ID = MyInlineTable.ID
  </code></pre>
  
  <p>I realize that I can do</p>
  
  <pre><code>SELECT 1,'a' UNION SELECT 2,'b' UNION SELECT 3,'c'
  </code></pre>
  
  <p>But that seems pretty evil</p>
  
  <p>I don't want to do a stored procedure because potentially a,b,c can change at every query and the size of the data as well. Also a stored procedure needs to be saved in the database, and I don't want to have to modify the database just for that.
  View is the same thing.</p>
  
  <p>What I am really looking for is something that does <code>SELECT 1,'a' UNION SELECT 2,'b' UNION SELECT 3,'c'</code> with a nicer syntax.</p>