您的位置:首页 > 数据库

收藏一个简单sql语句实现多查询的方法

2012-02-10 17:55 781 查看
declare @a nvarchar

--set @a=''
select * from students where (id between 1 and 5) and ((@a is null) or Name=@a)


这样实现where 后面多条件查询就简单很多!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐