已经写完的如下
select a.code,
a.work_start_date,
a.work_end_date,
a.trial_start_date,
a.trial_end_date,
b.salary,
c.name
from employee as b inner join labor_contract as a on b.id = a.id inner join post as c on a.id = c.id
我想计算 a.trial_start_date, 与a.trial_end_date,之间的时间差
希望能把您修改完的发到回答里边,会有回馈分的,万分感谢
请问我在C#中写了一段SQL语句,希望计算两个日期之间的天数,请问应该如何修改SQL语句?
答案:2 悬赏:30 手机版
解决时间 2022-01-01 14:42
- 提问者网友:战魂
- 2021-12-31 16:32
最佳答案
- 五星知识达人网友:底特律间谍
- 2021-12-31 17:09
select a.code,
a.work_start_date,
a.work_end_date,
DateDiff(d,a.work_start_date,a.work_end_date) AS wd,
a.trial_start_date,
a.trial_end_date,
DateDiff(d,a.trial_start_date,a.trial_end_date) AS td,
b.salary,
c.name
from employee as b inner join labor_contract as a on b.id = a.id inner join post as c on a.id = c.id
a.work_start_date,
a.work_end_date,
DateDiff(d,a.work_start_date,a.work_end_date) AS wd,
a.trial_start_date,
a.trial_end_date,
DateDiff(d,a.trial_start_date,a.trial_end_date) AS td,
b.salary,
c.name
from employee as b inner join labor_contract as a on b.id = a.id inner join post as c on a.id = c.id
全部回答
- 1楼网友:枭雄戏美人
- 2021-12-31 18:06
在表中再加一列 例如state 列。将这三列的state的值设为1.其他的为0.1就代表需要进货的那三个产品。 用select * from 表 where 单号=1001 and state=1 即可
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯