title: COLUMN NAME and COLUMN COMMENT from one table and COLUMN VALUE from another. How?
body: <p>I have a table called tbl_mainsheet7 created like this:</p>
  
  <pre><code>pk_mainsheet  client_id  project_id  mainsheet_id  project_cat  EA_WTRESRVD  EA_WTRESRV  EA_FEEASBT
  ------------  ---------  ----------  ------------  -----------  -----------  ----------  ----------
             1        111         222           333            3            0           0           0
             2         11          22            33            3            0           0           0
  </code></pre>
  
  <p>MySQL INFORMATION_SCHEMA.COLUMNS Query for tbl_mainsheet7 created like this:</p>
  
  <pre><code>SELECT `COLUMN_NAME`, `COLUMN_COMMENT` FROM INFORMATION_SCHEMA.COLUMNS WHERE `TABLE_NAME` = 'tbl_mainsheet7'
  </code></pre>
  
  <p>..returning this:</p>
  
  <pre><code>COLUMN_NAME    COLUMN_COMMENT                                        
  -------------  ------------------------------------------------------
  pk_mainsheet                                                         
  client_id                                                            
  project_id                                                           
  mainsheet_id                                                         
  project_cat                                                          
  EA_WTRESRVD    EMERGENCY SERVICE CALL                                
  EA_WTRESRV     EMERGENCY SERVICE CALL AFTER HRS                      
  EA_FEEASBT     ASBESTOS TEST FEE 
  </code></pre>
  
  <p><strong>How can I...</strong></p>
  
  <p>SELECT <code>COLUMN_NAME</code>, <code>COLUMN_VALUE</code>, <code>COLUMN_COMMENT</code> FROM ... WHERE...</p>
  
  <p>Maybe a JOIN? I am really scratching my head.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>So I got this to work but for a single predetermined column only. How can I use a variable to make this dynamic?</p>
  
  <p>Like replacing WTRESRVD with a variable relating to COLUMN_NAME</p>
  
  <pre><code>SELECT COLUMN_NAME, (SELECT EA_WTRESRVD FROM tbl_mainsheet7 WHERE client_id = '111') AS COLUMN_VALUE, COLUMN_COMMENT FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'tbl_mainsheet7'
  </code></pre>