利用unique 索引create UNIQUE INDEX uq_ot_empid_dateId on ot(empid,dateId);也可以直接在create table 时的SQL语句中加入。
看不到图,猜一下了。 各flowid的加班明细 select org.flowid,ot.* from ot,emp,org where org.lineId=emp.lineId and emp.empId=ot.empId order by org.flowid或者加班汇总 select org.flowid,sum(ot.hours) from ot,emp,org where org.lineId=emp.lineId and emp.empId=ot.empId group by org.flowid order by org.flowid
利用unique 索引create UNIQUE INDEX uq_ot_empid_dateId on ot(empid,dateId);也可以直接在create table 时的SQL语句中加入。
看不到图,猜一下了。
各flowid的加班明细
select org.flowid,ot.*
from ot,emp,org
where org.lineId=emp.lineId
and emp.empId=ot.empId
order by org.flowid或者加班汇总
select org.flowid,sum(ot.hours)
from ot,emp,org
where org.lineId=emp.lineId
and emp.empId=ot.empId
group by org.flowid
order by org.flowid