此查询基于事务表编写
SELECT Ecode,COUNT(*) AS recvd
FROM Transaction_tbl
WHERE Locid=5 AND dtime BETWEEN '5/1/2013 00:00:00' AND '6/10/2013 23:59:59'
GROUP BY Ecode
ORDER BY Ecode DESC
在执行此查询时,我会像这样
Ecode recvd
E003 24
E001 2
我还有一张像员工主表这样的表,对应的员工姓名是保存,我如何将此表加入员工主表
我想像这样出去
Ecode Ename Recvd
E003 jas 24
E001 deepu 14