原SQL中的语句
Select
a.*,QMZS1,QMZS2,b.YSYWF as PYSYWF,b.zdsfbzje,
case when a.YSYWF>isnull(b.YSYWF,0) then '大于' when a.YSYWF=isnull(b.YSYWF,0) then '等于' when a.YSYWF<isnull(b.YSYWF,0) then '小于' end as SFDB,
case when a.OfficeCode=b.BBPERSON or BBPERSON is null then '否' else '是' end as IsNext
into sTmp20191120200730520 From CheckBBList20191120200723541 a
left join (
Select TypeName, QMZS1,QMZS2, BBPERSON, BSDWMC,YSYWF,zdsfbzje From BB_Content1 a
Inner Join BB_Type b on a.TypeID=b.GUID Where left(BGRQ, 4)='2018' and BBPERSON is not null and BBState='报备完成'
) b on case when a.BBType= '经济责任审计' then '报备其他' else a.BBType end =b.TypeName and a.BSDWMC=b.BSDWMC
ORACLE中应该修改为:create table NewTable as select * from ATable;
create table sTmp2019112020