I have to implement the below decode function in sql server. In which, if the variable is empty, then all the rows to be retrieved by the query.
if the variable is empty the query ==> select * from TABLE where 1=1
ELSE select * from TABLE where DATA_column=p_col
Can you kindly let me know how can we achieve it in sql server