title: How to combine two tables to get results
body: <p>The following is my master table: </p>
  
  <pre><code>    tablename       columnname         size  order
      employee        name               25    1
      employee        sex                25    2
      employee        contactNumber      50    3
      employee        salary             25    4
      address         street             25    5
      address         country            25    6
  </code></pre>
  
  <p>And following is my child table:</p>
  
  <pre><code>    childid  userid  masterid  isactive  size   order
      1        1       1         Y         25     1
      2        1       2         Y         25     2
      3        1       3         N         0      0
      4        1       4         Y         50     3
  </code></pre>
  
  <p>I would like to get the table name columnname from master table and size,order form child table against userid when <code>isactive is Y</code> in child table.</p>
  
  <p>Some time, if the value is not there for the particular user than get all the values like tablename, columnname, size, order <code>where isactive is</code>Y</p>
  
  <p>I am really sorry to ask this but I am not good at SQL.</p>
  
  <p>Regards.</p>