sql server - How can I filter a SQL query by all matching values or all values and null values -
this query , not returning null values
select st.station stations st ((station = case when @station = n'*' station else @station end) or (station = case when @station = n'*' null else @station end))
try this:
select st.station stations st station = @station or @station = n'*'
if pass '*'
@station = n'*'
evaluate true , select row, else filter value of @station
variable.
Comments
Post a Comment