SELECT
B.CALDAY,A.BMZHMS,SUM(B.RS) as RS
FROM
(
SELECT DISTINCT
CALDAY,COUNT(EMPLOYEE) as RS, ZICZG0010
FROM
"_SYS_BIC"."CB.BL.YW/ZBL_ZDEYG001"
GROUP BY,CALDAY,ZICZG0010 ) B
RIGHT JOIN "_SYS_BIC"."ZBMJJB_BM" A
ON A.BMZH = B.ZICZG0010
(!这里查1个时间关联语句!)
WHERE A.BMZHMS = '东安店'
group by CALDAY,BMZHMS