title: SQL Query to bring group result of a column in multiple Column
body: <p>Trying to make a query which generate this kind of result</p>
  <pre><code>EmpId,  EmpSickLeave,EmpCasualLeave, EmpAnnualLeave, TotalLeave
  1,       1,           0,                0            1
  2,       0,           0,                2            2
  3,       0,           1,                0            1
  4,       0,           1,                0            1  
  5,       1,           0,                0            1
  </code></pre>
  <p>while I have two tables</p>
  <p><strong>Table EmpLeave:: include a column EmpId, Date, EmpLeaveTypeID</strong></p>
  <p><strong>Table EmpLeaveType:: include EmpLeaveTypeID and LeaveName</strong></p>
  <p>DATA In tables</p>
  <pre><code>EmpLeaveType Table
  EmpLeaveTypeID , LeaveName
  1,              Sick Leave
  2,              Annual
  3,              Casual
  
  EmpLeave Table
  column EmpId, Date, EmpLeaveTypeID
              1, 2015-07-01, 1
              3, 2015-07-02, 2
              5, 2015-07-04, 1
              4, 2015-07-04, 2
              2, 2015-07-05, 2
              2, 2015-07-07, 2
  </code></pre>
  <p>I am pulling my hair and unable to brind this kind of result. Is this possible?</p>
  <pre><code>  EEmpId,  EmpSickLeave,EmpCasualLeave, EmpAnnualLeave, TotalLeave
  1,       1,           0,                0            1
  2,       0,           0,                2            2
  3,       0,           1,                0            1
  4,       0,           1,                0            1  
  5,       1,           0,                0            1
  </code></pre>
  <p>This wrong thing I have tried!</p>
  <pre><code>    SELECT * count(EmpLeaveTypeID) FROM `EmpLeaveType`
  WHERE SwitchDate Between '2015-07-01' AND '2015-07-28'
  group by EmpLeaveType, EmpId
  </code></pre>