谢广坤(提问者)WHERE 1=1
),
L AS (SELECT NIANDU,EDTRM,ZKHFL,ZKHXSSR,ZBWWCDE FROM SAPABAP1.ZFRP0016 where NIANDU='2023')
${if("SELECT NIANDU SAPABAP1.ZFRP0016 WHERE NIANDU='2023'" IS NULL,'select * from k','select * from L')}
没有识别${if 这种}
snrtuemc 回复 谢广坤(提问者)你写法问题,${if("SELECT NIANDU SAPABAP1.ZFRP0016 WHERE NIANDU='2023'" IS NULL,'select * from k','select * from L')}改成,${if(sql("数据库连接名","SELECT NIANDU SAPABAP1.ZFRP0016 WHERE NIANDU='2023'",1,1) =0,'select * from k','select * from L')} if中直接sql语句不行,需要sql函数获取才可以