1
我最近得到这个存储过程,它使用了一个名为@marketCode的变量。应用程序传递此变量的南或空。使用搜索的情况下,在哪里条件
在我的select语句中,我想检索除South以外的每个市场,如果应用程序传递null。
and marketCode =! 'South'
如果应用程序传递非空值,那么我将使用该值。
and marketCode = 'North'
我怎样才能将这两个加入到一个案例中?
AND marketCode = (case @marketCode when null then <..not equal to 'South'..>
else <..equal to 'South'..> end)
非常感谢你! – CFNinja 2014-11-04 22:13:43