ORACLE
创建临时表,保存相关数据
create table T_FSA_Salarybacknew as
select fid,fcreatorid,fcreatetime,flastupdateuserid,flastupdatetime,fcontrolunitid,fpersonid,fsocialnumber,fpositionsalarydji,fpositionsalarydxi,FbaseSalaryStart,fbaseSalaryGrade
,fbasesalary,fhousebstandard,fpsalarystandard,fcomhousefundb,fcomhousefund,femphousefundb,femphousefund,fcomplanno,fpersonplanno,fpreyearavgsalary,fannuitydate,fpreyearavgsocial,fhousefundbase,fbizdate,fiscurrent,fremark
,newbosid('') newwid from table a where a.fid in ( select fid from ( SELECT fid,FPERSONID,FBIZDATE, row_number() over (partition by FPERSONID order by FBIZDATE desc) as row_num
FROM table )where row_num=1) and a.FPERSONID in (...)