桃花依旧笑我疯(提问者) 回复 shiroko是的,fdlx==0这个条件满足的时候,报错了,脚本如下。
SELECT
*
FROM
yxxt_admin.base_org_zhtj
WHERE
power_type_code in
${
IF
( len ( fdlx )== 0, \"select power_type_code from yxxt_admin.base_org_zhtj group by power_type_code\", \"(\'\"+ fdlx+\"\')\" )}
桃花依旧笑我疯(提问者) 回复 zsh331谢谢,已经改好了。另外说一下,in后如果加大括号()的话,里面的参数就失效了(即无法刷新出fdlx这个参数),查询就不起做了。
SELECT org_code FROM yxxt_admin.base_org_zhtj
WHERE ${
IF
( len ( fdlx )== 0, \"power_type_code in (select power_type_code from yxxt_admin.base_org_zhtj group by power_type_code)\", \"power_type_code=\'\"+ fdlx+\"\'\")}
桃花依旧笑我疯(提问者)谢谢你,已按下面语句解决:
SELECT
*
FROM
yxxt_admin.base_org_zhtj
WHERE
power_type_code in
${
IF
( len ( fdlx )== 0, \"select power_type_code from yxxt_admin.base_org_zhtj group by power_type_code\", \"(\'\"+ fdlx+\"\')\" )}
桃花依旧笑我疯(提问者)你好,in后加大括号的话,参数fdlx就失效了。我这样写的
SELECT org_code FROM yxxt_admin.base_org_zhtj
WHERE ${
IF
( len ( fdlx )== 0, \"power_type_code in (select power_type_code from yxxt_admin.base_org_zhtj group by power_type_code)\", \"power_type_code=\'\"+ fdlx+\"\'\")}
能出来我想要的效果了。谢谢。