摘要: 字段名:Bran,block,are,store 四个字段中存在值等于0或者不等于0,两种情况。where中如果用if等条件判断会有16中组合,如果采用where中的条件就避免了这个情况。declare @a intdeclare @b intdeclare @c intdeclare @d intset @a=0set @b=0set @c=0set @d=0select * from ABC_Tablewhere (b.Bran =@a or @a=0)and (b.block =@b or @b=0)and (b.are=@c or @c=0)and (a.store =@d or @d 阅读全文
posted @ 2013-07-19 10:29 笑看天下 阅读(690) 评论(0) 推荐(0) 编辑