多个条件查詢,可以只输入一个,也可以输入2个或多个.甚至不输入.不输入就列出全部.
select * from 表名
where (名字
=@name or @name is null) and (工资<@pay1 or @pay1 is null) and (工资>@pay2 or @pay2 is null)
转载于:https://www.cnblogs.com/Bluer/archive/2006/07/20/455110.html
转载于:https://www.cnblogs.com/Bluer/archive/2006/07/20/455110.html