27,579
社区成员
发帖
与我相关
我的任务
分享
最好给出完整的表结构,测试数据,计算方法和正确结果.
update savemoney
set SaveMoneyEmployee=d.emp_no
from savemoney as a,(select guest_no,emp_no,bdate,edate,cb from mtlguestye) as d
where a.guest_no = d.guest_no and a.cb = d.cb and (a.业务代码 = '' or a.业务代码 is null)
a.edate = (select max(edate) from savemoney where mdate = a.mdate and 代码 = a.代码 and (业务代码 = '' or 业务代码 is null))
最好给出完整的表结构,测试数据,计算方法和正确结果.