描述:当字段Column1不为空时,增加条件condition
select * from table where (OtherCondition) and (Column1 is NULL or (Column1 is not NULL and condition))
如果没有其它条件(OhterCondition),将其去掉即可。
描述:当字段Column1不为空时,增加条件condition
select * from table where (OtherCondition) and (Column1 is NULL or (Column1 is not NULL and condition))
如果没有其它条件(OhterCondition),将其去掉即可。
转载于:https://www.cnblogs.com/cccliche/p/sql_20150430_01.html