create procedure test (@A int)
as
if (@A=1)
begin
select columna,columnb,columnc from tablea where ...
end
else if (@A=2)
begin
select columna,columnb,columnc from tablea where ...
end
else if(@A=3)
begin
select columna,columnb,columnc from tablea where ...
end
as
if (@A=1)
begin
select columna,columnb,columnc from tablea where ...
end
else if (@A=2)
begin
select columna,columnb,columnc from tablea where ...
end
else if(@A=3)
begin
select columna,columnb,columnc from tablea where ...
end
如:
where (a=1)and(b=1)and(if c=1 then d=1 else d=2)
主要是后面一个 语句条件 多种选择怎么搞
and (
( (c=1) and (d=1) ) or ( (c<>1) and (d=2) )
)