title: How to combine results of 3 Joins?
body: <p>I am trying to make a table per employee that will give the information per employee that was present/absent/work from home.For that I am writing a SQL query that is fetching the records using JOINS. However, I am writing 3 Join statements that are returning me data separately. How can I write a query that will return the results of the 3 subsequent joins in one single (SELECT)query? Here are the Join statements:</p>
  
  <pre><code>Select EmployeeId, Employees.Name, COUNT(*) [Absent]
  From Attendances
  Left Join Employees
  On Employees.EmployeeId = Attendances.EmpID And Attendances.IsAbsent = 1 and Employees.Name = 'John'
  Where CAST(Attendances.InDateTime as Date) &gt;= '2016-06-19 10:00:00.000' 
  Group By EmployeeId, Employees.Name
  
  select Employees.Name, COUNT(*) [Present]
  from Employees
  Inner Join Attendances
  On Employees.UserId = Attendances.EmpID and Attendances.IsAbsent = 0
  Where CAST(Attendances.InDateTime as Date) &gt;= '2017-06-19 10:00:00.000' and Employees.Name='John'
  Group By Employees.Name
  
  select Employees.Name, COUNT(*) [WorkFromHome]
  from Employees
  Inner Join Attendances
  On Employees.UserId = Attendances.EmpID and Attendances.IsWorkFromHome = 1
  Where CAST(Attendances.InDateTime as Date) &gt;= '2017-06-19 10:00:00.000' and Employees.Name='John'
  Group By Employees.Name
  </code></pre>
  
  <p>The current output that I am getting is:
  Name|Present, Name|Absent, Name|WorkFromHome
  But I want it as:
  Name|Present|Absent|WorkFromHome</p>