我有 2 张表mstEmp和dailyattendance。现在我想运行一个查询
SELECT
mstEmp.empname,
dailyattendance.InTime,
dailyattendance.OutTime,
mstEmp.teamtype
FROM
dailyattendance ,
mstEmp mstEmp
where
dailyattendance.HolderName IN (
select mstEmp.empname from mstEmp where mstEmp.teamtype='$chk' )
这里匹配了teamtype ,从mstEmp中获取对应的名称,然后与dailyattendance.HolderName匹配以显示结果。