执行 SQL 查询报错

数据库是 oracle,HR_PROD_MATERIAL 物料表的字段 PRODUCE_DT 的值为 2024-12-18 19:44:41.000 类型为 date;报表查询参数设置为查询一天为字符串类型输入 2024-12-18,SQL 如下在 plsql 运行正常设置为 2 个传参符号?就报错执行错误,SQL 参数异常或者 SQL 语句语法错误
错误来源:ORA-00933: SQL 命令未正确结束
设置一个参数 where 条件设置 trunc(t.PRODUCE_DT) = to_date(?, ‘yyyy-MM-dd’) 还是报同样错,请求高手帮忙解决谢谢!

SELECT
LINE,
SHOP_SIGN,
PRODUCE_MODEL,
PRODUCE_IDENTIF,
COUNT(CASE WHEN LINE = ‘一棒’ THEN 1 END) AS HBM1_COUNT,
COUNT(CASE WHEN LINE = ‘二棒’ THEN 1 END) AS HBM2_COUNT,
COUNT(CASE WHEN LINE = ‘三棒’ THEN 1 END) AS HBM3_COUNT,
COUNT(CASE WHEN LINE = ‘一高线’ THEN 1 END) AS HWM1_COUNT,
COUNT(CASE WHEN LINE = ‘二高线’ THEN 1 END) AS HWM2_COUNT,
COUNT(*) AS TOTAL_COUNT
FROM (
SELECT
t.SID,
DECODE(t.PRODUCE_LINE,
‘HBM1’, ‘一棒’,
‘HBM2’, ‘二棒’,
‘HBM3’, ‘三棒’,
‘HWM1’, ‘一高线’,
‘HWM2’, ‘二高线’) AS LINE,
t.SHOP_SIGN,
t.PRODUCE_MODEL,
u.PRODUCE_IDENTIF,
t.PRODUCE_DT
FROM
HR_PROD_MATERIAL t
JOIN
HR_PLAN_ASSEMBLY u
ON
t.ASSEMBLY_NO = u.ASSEMBLY_NO
AND t.HEAT_NO = u.HEAT_NO
WHERE

–PRODUCE_DT = to_date(‘2024-11-08’, ‘yyyy-MM-dd’)

–PRODUCE_DT= TO_DATE(?,‘yyyy-MM-dd’)
–PRODUCE_DT >= to_date(?, ‘yyyy-MM-dd’) AND PRODUCE_DT < to_date(?, ‘yyyy-MM-dd’) 查询报一样错 ORA-00933
PRODUCE_DT >= to_date(‘2024-12-08’, ‘yyyy-MM-dd’) AND PRODUCE_DT < to_date(‘2024-12-09’, ‘yyyy-MM-dd’)
) sub
GROUP BY
LINE,
SHOP_SIGN,
PRODUCE_MODEL,
PRODUCE_IDENTIF
ORDER BY
TOTAL_COUNT DESC;