永洪社区

标题: sql [打印本页]

作者: yhdata_R1dfhSqV    时间: 2023-3-9 14:48
标题: sql
本帖最后由 yhdata_R1dfhSqV 于 2023-3-9 14:52 编辑

select * from table
where 1=1
and (<one> one in (?{one})</one>
or (<two> twoin (?{two})</two>
<three>  and c_gysbm in (?{c_gysbm }) </c_gysbm >)

这个sql怎么改?
逻辑是
当填入one参数    返回one字段满足的数据
或者 同时是满足 two、three 两个参数满足的数据



作者: yhdata_ruby    时间: 2023-3-9 14:50
什么问题啊
作者: yhdata_R1dfhSqV    时间: 2023-3-9 14:53
yhdata_ruby 发表于 2023-3-9 14:50
什么问题啊

刷新下   刚不小心没保存上
作者: yhdata_ruby    时间: 2023-3-9 14:58
yhdata_R1dfhSqV 发表于 2023-3-9 14:53
刷新下   刚不小心没保存上

参考数据集使用参数https://www.yonghongtech.com/rea ... paramindataset.html
作者: yhdata_R1dfhSqV    时间: 2023-3-9 14:58
我现在这个sql执行报错哦    不知道怎么改
作者: yhdata_ruby    时间: 2023-3-9 15:02
yhdata_R1dfhSqV 发表于 2023-3-9 14:58
我现在这个sql执行报错哦    不知道怎么改

报什么错看一下
作者: yhdata_R1dfhSqV    时间: 2023-3-9 15:04
本帖最后由 yhdata_R1dfhSqV 于 2023-3-9 15:07 编辑

我的疑问是怎么用one  or (two and three)  作为where  这是三个参数

作者: yhdata_ruby    时间: 2023-3-9 15:13
AND (<市场>市场分布= ?{市场} </市场> or
<级别> 市场级别= ?{级别} </级别>)




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