Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SQL Where Column1 = Column1 will only return non-nulls
- Select * from User where Country = Country
- Select * from User where Country = coalesce(@Country, Country)
- Select *
- from User
- where @Country is null or Country = @Country
- option (recompile)
- IF @Country is null
- Select *
- from User
- ELSE
- Select *
- from User
- Where Country = @Country
Add Comment
Please, Sign In to add comment