sql 为空不做查询条件

select * from usertable where 1=1 and (name=@name or @name='') and (page=@page or @page='')

原文地址:https://www.cnblogs.com/muxueyuan/p/11067336.html