本文介绍了我怎样才能找到剩余的小时数,请帮忙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有下表 和记录。从下面的记录中,我想找到他们拍摄后剩下的剩余时间。请帮我建议使用sqls来获得剩余假期
(Empid int,
Empname varchar(max)
HolidayEntitled dec(5,2) ))
创建表tblHoliday
(empid int,
dateHoliday datetime,
Descr varchar(max),
HolidayHrs dec(5,2))
插入到TblEmp
tblEmp
(Empid,EmpName,HolidayEntitled)
值
(1,'Employee1',210.30),//
(2,'Employee2'210.45),
(3,'Employee3'230.30)
插入tblHoliday
(Empid,EmpName,Descr,HolidayHrs)
值
(1,'01 -01-2019','NewYear'7.30),
(2,'01 -01-2019','NewYear'7.30),
(3 ,'01 -01-2019','NewYear'7.30),
(1,'10 -02-2019','假日'7.45),
(2,'10 -03-2019' ,'假日'7.50),
(3,'10 -03-2019','假日'1.59),
(1,'01 -05-2019','假日'8.00),
(2,'10 -05-2019','假日'7.15),
(3,'15 -05-2019','假日'3。 15)
输出应该是
谢谢
Pol
polachan
解决方案
I have the following table and Records. From the following record , I want to find remaining hrs entitled for Holiday after they have taken. Please help me with suggested sqls to get the remaining holiday
(Empid int, Empname varchar(max) HolidayEntitled dec(5,2)) Create table tblHoliday (empid int, dateHoliday datetime, Descr varchar(max), HolidayHrs dec(5,2)) insert into TblEmp tblEmp (Empid,EmpName,HolidayEntitled ) Values (1,'Employee1',210.30), // (2,'Employee2' 210.45), (3,'Employee3'230.30) Insert into tblHoliday (Empid,EmpName,Descr , HolidayHrs ) Values (1, '01-01-2019','NewYear' 7.30), (2, '01-01-2019','NewYear' 7.30), (3, '01-01-2019','NewYear' 7.30), (1, '10-02-2019','Holiday' 7.45), (2, '10-03-2019','Holiday' 7.50), (3, '10-03-2019','Holiday' 1.59), (1, '01-05-2019','Holiday' 8.00), (2, '10-05-2019','Holiday' 7.15), (3, '15-05-2019','Holiday' 3.15)
Output should be
With Thanks
Pol
polachan
解决方案
这篇关于我怎样才能找到剩余的小时数,请帮忙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!