title: How to create multiple alias for child table in mysql
body: <p>In my company we actually transfer materials between warehouses referring a particular Production Order number. When entering a production order the materials transferred between different workstations would appear in rows .</p>
  <pre><code>select
      ste.production_order as &quot;Production Order:Link/Production Order:120&quot;,
      ste_item.qty as &quot;Qty:Float:60&quot;,
  ste_item.s_warehouse as &quot;Source Warehouse:Data:120&quot;,
      ste_item.t_warehouse as &quot;Target Warehouse:Data:120&quot;
          
  from
      `tabStock Entry` ste INNER JOIN `tabStock Entry Detail` ste_item ON ( ste.name = ste_item.parent and ste.docstatus = 1 and ste.purpose in ('Material Transfer'))
  </code></pre>
  <p><a href="https://i.stack.imgur.com/ALnA1.png" rel="nofollow noreferrer">Different warehouses as rows</a></p>
  <p>now I planned to create alias for the child table Stock Entry Detail so that I could select warehouses from the first alias and add warehouses adjacent so instead of appearing in rows everything would appear in columns.But creating alias for the child table displays nothing .</p>
  <p>I tried with this code :</p>
  <pre><code>select
      ste.production_order as &quot;Production Order:Link/Production Order:120&quot;,
      ste_item.qty as &quot;Cutting Qty:Float:60&quot;,
      ste_item1.qty as &quot;Forging Qty:Float:60&quot;
          
  from
      `tabStock Entry` ste JOIN `tabStock Entry Detail` ste_item ON ( ste.name = ste_item.parent and ste.docstatus = 1 and  ste_item.t_warehouse in ('Cutting - OMMIFORGE'))
  
  JOIN `tabStock Entry Detail` ste_item1 ON ( ste.name = ste_item1.parent and ste.docstatus = 1 and  ste_item1.t_warehouse in ('Forging - OMMIFORGE'))
  </code></pre>
  <p>Guys any help ?</p>
  <p>Thanks</p>