PG的sql语句的组织,由于特殊有点小麻烦。掌握方法就简单了
函数:"fn_BillsCharge2Account"("aSQlConditionStr" varchar)调用:
SELECT "public"."fn_BillsCharge2Account"('("科室代码" = ''101001'')') AS "Result"
其中参数:("科室代码" = '101001')。我们处理加工这样:
aCondition := '"科室代码" = '101001''
aSQL := 'SELECT "public"."fn_BillsCharge2Account"('+QuotedStr(aCondition)+') AS "Result" ';
另外:通常账期格式:2022-05。那么sql的where表达:
select to_char(now(),'YYYY-MM')='2022-05'