我有两个不同的查询产生了正确的结果,但我想让它们在一张表中产生答案。我怎么做?
这是我的代码:
SELECT count(distinct ID) as NoOfEmployees
FROM Table_Name
WHERE date<= '2012-05-31';
select count(subA.ID) as EmployeesChanged from (
SELECT A.ID
FROM Table_Name A
WHERE A.date < '2012-06-01'
GROUP BY 1
HAVING COUNT(A.Service_type) > 1 ) subA
目前我有以下输出:
在职员工人数 X
员工变动 X
我该怎么做
员工人数 | 员工变动 | (员工人数 - 人数变化) x | x | X