查询 1:
select EmpID, count(ProgramId) as "TotalPrograms",
SUM(Cast([NoOfDays] as INT) ) as "Total No of Days"
from **EmpTrainingInfo** group by EmpID
结果输出: EmpID Total Programs ,Total No Of Days
查询 2:
select AssignedTo [EmpID] ,count(ProgramId) as "Total Foreign Visits"
from **ProgramInfo** where status in ('Completed','Assigned')
and Country NOT IN ('Country1','Kountry1 ','cntry1') group by AssignedTo
结果输出:EmpID,外国访问总数
如何将这两者结合起来以在一个表中获取输出列:
**EmpID** , **Total Programs** ,**Total No Of Days**,Total Foreign Visits
任何提示将不胜感激..