title: SELECTing the column names for another SELECT - possible?
body: <p>I have a table t1 with a 'foo' column, and records containing 'bar' and 'baz' in column 'foo'. I also have a table t2 with columns 'bar', 'baz' and 'quux'. I want to do something like the following:</p>
  
  <pre><code>SELECT (SELECT foo from t1) FROM t2;
  </code></pre>
  
  <p>that is, get the two column names from t1 and query those columns of t2. If I try to do this with MonetDB, I get an error message:</p>
  
  <pre><code>cardinality violation (2&gt;1)
  </code></pre>
  
  <p>so,</p>
  
  <ul>
  <li>is there some other way to do this with MonetDB?</li>
  <li>is this possible in MySQL? other DBMSes?</li>
  </ul>
  
  <p>Example queries (or non-query directives followed by a query) are welcome.</p>