another query
-
i have a parameter named @State my where clause is depend on this parameter for example if @State=1
select . . . From ... where Status=true AND Response=false
if @State=2select . . . From ... where Status=false AND UserId>@Number;
i want some thing like switch case in my where clause what should i do? -
i have a parameter named @State my where clause is depend on this parameter for example if @State=1
select . . . From ... where Status=true AND Response=false
if @State=2select . . . From ... where Status=false AND UserId>@Number;
i want some thing like switch case in my where clause what should i do?Perhaps this would help
(Status=true AND Response=false and @State=1) or (Status=false AND UserId>@Number and @State=2)
-
Perhaps this would help
(Status=true AND Response=false and @State=1) or (Status=false AND UserId>@Number and @State=2)
thanks it does work fine!