title: is there a way to dynamically join between tables?
body: <p>Given tabes A and A1 - A100 with these schemas:</p>
  
  <pre><code>CREATE Table A(
  ID INT NOT NULL,
  Value1 VARCHAR(10) NOT NULL,
  TableName VARCHAR(4) NOT NULL
  )
  
  INSERT INTO A
  (1, 'Val1', 'A1'),
  (2, 'Val2', 'A5')
  
  CREATE TABLE A1( --and same for tables A2 - A100
  ID INT NOT NULL,
  Value2 VARCHAR(10) NOT NULL
  )
  
  INSERT INTO A1
  (1, 'Val74')
  INSERT INTO A5
  (1, 'Val39')
  </code></pre>
  
  <p>How can I do the following? (pseudo-code)</p>
  
  <pre><code>SELECT A.Value1, X.Value2
  FROM A INNER JOIN X ON A.TableName = X
  </code></pre>
  
  <p>And produce:</p>
  
  <pre><code>Value1  Value2
  Val1    Val74
  Val2    Val39
  </code></pre>