title: Additional inner join modifying results of previous calculations
body: <p>I am having issues with using the count() function in an sql plus query.. say if </p>
  
  <pre><code>    SELECT B.ID COUNT(S.BRANCH_ID) FROM BRANCH B 
      INNER JOIN STAFF S ON S.BRANCH_ID = B.ID
      GROUP BY B.ID;
  </code></pre>
  
  <p>from doing this I'll get the results</p>
  
  <pre><code>            b.id             count
               1                  6
               2                  6
               3                  6
               4                  7
               5                  6
  </code></pre>
  
  <p>which is fine.. However if I even add an extra inner join i'll get completely different and wrong results.. So if I put for example..</p>
  
  <pre><code>           SELECT COUNT(S.BRANCH_ID) FROM BRANCH B 
             INNER JOIN STAFF S ON S.BRANCH_ID = B.ID
             INNER JOIN TOOL_STOCK TS ON TS.BRANCH_ID = B.ID
             GROUP BY B.ID;
  </code></pre>
  
  <p>Now the results I get will be...</p>
  
  <pre><code>           b.id             count
              1                 96
              2                 96
              3                 96
              4                112
              5                 96
  </code></pre>
  
  <p>Why is this and how do I stop it? Cheers!</p>