永洪社区

标题: 数据集参数使用 [打印本页]

作者: yhdata_5vuToXP2    时间: 2023-11-3 10:53
标题: 数据集参数使用
select id,sum(count) as count
    from  sql_data
    where 1=1
    <a> and  a= ?{a} </a>
    <b> and  b= ?{b} </b>
    group by a, b, id

在sql数据集中,有没办法参数a输入为空时,不对a进行group by,即group by b,id
目的是对b的所有用户(id)计算频次(count)



作者: yhdata_lyaa    时间: 2023-11-3 11:23
不可以呢
作者: yhdata_5vuToXP2    时间: 2023-11-3 13:18
谢谢
作者: yhdata_lyaa    时间: 2023-11-3 13:30
yhdata_5vuToXP2 发表于 2023-11-3 13:18
谢谢






欢迎光临 永洪社区 (http://club.yonghongtech.com/) Powered by Discuz! X3.4