title: Get records per divisions from Loc_hist table by joining with area table
body: <p>I have 2 tables called area and loc_hist. </p>
  
  <p>In area table division list is present and in loc_hist division is combined with other 3 number and gives other details. 
  INPUT</p>
  
  <p><strong>Area</strong></p>
  
  <pre><code>div div_name 
  11    ATALANTA 
  14    Columbo  
  </code></pre>
  
  <p><strong>Loc_Hist</strong></p>
  
  <pre><code>Item Loc  
  0012 11378 
  0013 11378 
  0014 11378 
  0015 14425 
  </code></pre>
  
  <p>Here Loc is (first 2 digit of div+last 3 digit of other column). </p>
  
  <p><strong>OUTPUT</strong></p>
  
  <pre><code>Div Count(records)
  11   3
  14   1
  </code></pre>
  
  <p>So here my question is how to take records from loc_hist table per divisions?
  Thanks in advance</p>