情景:
需要传一段SQL语句给对方做帆软报表,其中出现一种情况:参数可不选亦可多选。
(case when ifnull("
p
a
y
W
a
y
"
,
99
)
=
99
t
h
e
n
1
=
1
e
l
s
e
t
.
p
a
y
W
a
y
i
n
(
s
e
l
e
c
t
m
e
t
a
v
a
l
u
e
f
r
o
m
s
y
s
m
e
t
a
w
h
e
r
e
l
a
n
g
t
y
p
e
=
′
z
h
c
n
′
a
n
d
m
e
t
a
f
l
a
g
=
′
p
a
y
W
a
y
′
a
n
d
f
i
n
d
i
n
s
e
t
(
m
e
t
a
v
a
l
u
e
,
"
{payWay}", 99) = 99 then 1=1 else t.payWay in (select meta_value from sys_meta where lang_type = 'zh_cn' and meta_flag = 'payWay' and find_in_set(meta_value, "
payWay",99)=99then1=1elset.payWayin(selectmetavaluefromsysmetawherelangtype=′zhcn′andmetaflag=′payWay′andfindinset(metavalue,"{payWay}")) end)
MySQL之find_in_set用法
最新推荐文章于 2022-03-25 16:02:41 发布