3,491
社区成员
发帖
与我相关
我的任务
分享
select *
from table1
where (case
when &a = 0 then
1
else
0
end) = 1
or store_no = &a
&a为输入参数
where 字段1 in(
select store_no from store where status=1 and 输入参数= 0
union all
select store_no from store where store_no in (48,50) and (输入参数 != 0 or 输入参数 is null)
)
PS: 这些条件,从前台处理,不更好吗?