帆软参数报错

select* from ads_gsms.salestation_poi_holo where city in '${city}' 

and brand = '${brand}',这是我的sql,为啥会报错误呢

image.png

FineReport 用户sxjlx97327076 发布于 2025-7-23 14:42
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共4回答
最佳回答
1
snrtuemcLv8专家互助
发布于2025-7-23 14:43(编辑于 2025-7-23 14:44)

估计你的分隔符不对,还有,in的话是  in('XXXX')

参考

select* from ads_gsms.salestation_poi_holo where city in ('${replace(city,",","','")}')

and brand = '${brand}'

最佳回答
1
LTC朝Lv6高级互助
发布于2025-7-23 14:43

参数值不要带引号

最佳回答
1
ID1208Lv6高级互助
发布于2025-7-23 14:44(编辑于 2025-7-23 15:03)

分隔符那里设置得有问题吧?

多了一对引号

image.png

image.png

最佳回答
1
微笑背后的无奈Lv4见习互助
发布于2025-7-23 14:45(编辑于 2025-7-23 14:47)

city这个参数 返回值你要这样子设置下image.png同时写in的这个 你要考虑空的情况,建议改成

select* from ads_gsms.salestation_poi_holo where 

 brand = '${brand}'

${if(city='',"and 1=1","and city in ('" + ciity + "')")}

  • 5关注人数
  • 41浏览人数
  • 最后回答于:2025-7-23 15:03
    请选择关闭问题的原因
    确定 取消
    返回顶部