有三个字段ABC 如果不是null就放到存储条件中去,好像这样:
SQL="SELECT * FROM 表1 where 字段4=4"
if A is not null then
sql+="and A=@A"
end if
if B is not null then
sql+="and B=@B"
end if
if C is not null then
sql+="and C=@C"
end if
在存储过程中怎么写呀???
...全文
384打赏收藏
动态增加查询条件的存储过程如何写?
有三个字段ABC 如果不是null就放到存储条件中去,好像这样: SQL="SELECT * FROM 表1 where 字段4=4" if A is not null then sql+="and A=@A" end if if B is not null then sql+="and B=@B" end if if C is not null then sql+="and C=@C" end if 在存储过程中怎么写呀???