How can I implement the where clause statement in the where clause?
You need to do the following:
stored procedure accepts @type int
select * from table as t where case @type when 1 then t.type = 1 when 2 then t.type != 1 when 3 then t.type = t.type ms sql server 2012