title: write a query to get Desired SQL table output
body: <p>I have some tables and find the desired output with the following table using sql query. tables are:</p>
  
  <pre><code>EmpID   TabId
  101   1
  102   2
  103   3
  104   4
  105   1
  </code></pre>
  
  <p>where table name is <code>Master</code></p>
  
  <pre><code>EmpID   Name
  101   A1
  102   A2
  103   A3
  104   A4
  105   A5
  </code></pre>
  
  <p>table name is <code>TableA</code></p>
  
  <pre><code>EmpID   Name
  101   B1
  102   B2
  103   B3
  104   B4
  105   B5
  </code></pre>
  
  <p>table name is <code>TableB</code></p>
  
  <pre><code>EmpID   Name
  101   C1
  102   C2
  103   C3
  104   C4
  105   C5
  </code></pre>
  
  <p>table name is <code>TableC</code></p>
  
  <pre><code>EmpID   Name
  101   D1
  102   D2
  103   D3
  104   D4
  105   D5
  </code></pre>
  
  <p>table name is <code>TableD</code></p>
  
  <pre><code>TabId   Name
  1     TableA
  2     TableB
  3     TableC
  4     TableD
  </code></pre>
  
  <p>table name is <code>AttMaster</code> is provided to us and desired output is below</p>
  
  <pre><code>TabId   Name
  101     A1
  102     B2
  103     C3
  104     D4
  105     A5
  </code></pre>
  
  <p>kindly help me how can I get desired output with sql query. I did not get any solutions to find the output.</p>