title: Select no. of people based on values in two tables
body: <p>I have two tables as follows :-</p>
  <p><strong>Table 1</strong></p>
  <pre><code>Id_1    Name            Country     status1     flag
  ===================================================
  1     Person AB          IN          1           0
  2     Person BC          US          1           0 
  3     Person CD          UK          1           0
  4     Person DE          IN          1           0
  
  </code></pre>
  <p><strong>Table 2</strong></p>
  <pre><code>Id_2     Role            Gender     status2     flag
  ===================================================
  1        rol1             Female     1           0
  2        rol2             Male       1           0 
  3        rol3             Male       1           0
  4        rol4             Female     1           0
  
  </code></pre>
  <p><strong>I want to count the number of <em>Females</em> living in <em>IN</em> and status1 = 1</strong></p>
  <p>I have this MySQL Statement :-</p>
  <pre><code>SELECT COUNT(*) into TotalFemales FROM Table1 tb1 JOIN Table2 tb2 
  on tb1.Id_1=tb2.Id_2
  WHERE tb1.flag=false and tb1.Country='IN' and tb1.status1=1 a tb2.Gender='Female';
  </code></pre>
  <p>But, I am getting 0 everytime.</p>