Alternatively to the ISNULL / COALESCE options, you can test the parameters for being null:SELECT NAMEFROM TABLEWHERE (@City IS NULL OR City = @City)AND (@Gender IS NULL OR Gender = @Gender)AND (@Age IS NULL OR Age = @Age) 这篇关于WHERE 子句中的可选参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!