VenueCity = ISNULL(@VenueCity,VenueCity)
如果参数@VenueCity为null,则此语句返回VenueCity的所有值,不包括其空值。如果参数@VenueCity为null,我怎样才能获得VenueCity字段的所有值,包括null?
答案 0 :(得分:1)
请尝试:
ISNULL(VenueCity, '')=ISNULL(@VenueCity, ISNULL(VenueCity, ''))
OR
ISNULL(VenueCity, '')=case when ISNULL(@VenueCity,'')='' then ISNULL(VenueCity, '') else @VenueCity end