我有一个程序,我试图根据高于规定参数的度量值来选择结果。但是,我希望大于可以更改为等于或小于。
我尝试将 > 替换为参数,但它给了我错误:sql 语法错误:“PARAM_OP”附近的语法不正确(其中 PARAM_OP 是应替换为操作符的参数的名称。
任何想法都会受到欢迎。
下面的代码:
var_out =
SELECT
"Col1" AS "Col1",
"Col2" AS "Col2",
"Col3" AS "Col3",
SUM(Col4) AS "Col4"
FROM <schema>.<view>
WHERE "Col2" = PARAM_1
GROUP BY Col1, Col2, Col3
HAVING SUM(Col4) > PARAM_2
ORDER BY SUM(Col4);