22,210
社区成员
发帖
与我相关
我的任务
分享
要实现这样的查询
当 入参为 -1 时,不执行此条件,当入参为一个有效的字符串时,执行charindex()判断
case when @sell_plan_type = '-1' then sell_plan_type=sell_plan_type else charindex(sell_plan_type,@sell_plan_type)>0 end)
case when @sell_plan_type = '-1' then sell_plan_type=sell_plan_type else
charindex(sell_plan_type,@sell_plan_type) end)