create proc_Analyse
@b varchar(20),
@c varchar(20)
as
if @b is null and @c is null
select a,b,c from t
else
select a,b,c from t where b=@b and c=@c
go
@b varchar(20),
@c varchar(20)
as
if @b is null and @c is null
select a,b,c from t
else
select a,b,c from t where b=@b and c=@c
go
create proc_Analyse
@b varchar(20),
@c varchar(20)
as
select a,b,c from t where b=isnull(@b,b) and c=isnull(@c,c)
go
@b varchar(20)=null,
@c varchar(20)=null
as
if @b is null and @c is null
select a,b,c from t
else
select a,b,c from t where b=@b and c=@c
go
create proc_Analyse
@b varchar(20) = null,
@c varchar(20) = null
as
select a,b,c from t where b=isnull(@b,b) and c=isnull(@c,c)
go
@b varchar(20) =null,
@c varchar(20) = null
asselect a,b,c from t where b=isnull(@b,b) and c=isnull(@c,c)else
go
create proc proc_Analyse
@b varchar(20) = null,
@c varchar(20) = null,
@d varchar(20) = null
as
select a,b,c from t where b=isnull(@b,b) and c=isnull(@c,c) and d = isnull(@d,d)
go
谢谢两位了 结贴