select sum(休息时间) from table2 where [id]>(select id from table2 where stime <='8:45' and etime>='8:45') and [id] <=(select id from table2 where stime <='9:30' and etime>='9:30')自己搞定了能不能加分?
insert into tablename select ....from ...
select sum(休息时间) from table1 where [id]> (select id from table1 where stime <='8:45' and etime> ='8:45') and [id] <=(select id from table1 where stime <='9:30' and etime> ='9:30') '8:45' '9:30'从表2中取
select ....from
...