Multiple account with different conditions

advertisements

I want to retrieve and display on one row, the number of sales made by an employee followed by the total number of sales.

SELECT COUNT(SalesID) AS SalesForEmployee, COUNT(SalesID) AS TotalSales
FROM Sales
WHERE EmployeeID = 123

How do I make it so that the where clause only applies to the first column in the select?


SELECT
  sum(case when EmployeeID = 123 then 1 else 0 end) AS SalesForEmployee
 ,COUNT(SalesID) AS TotalSales
FROM Sales