Switch case in where clause (sql server)

Posted by user685565 on Stack Overflow See other posts from Stack Overflow or by user685565
Published on 2012-03-31T11:15:49Z Indexed on 2012/03/31 11:29 UTC
Read the original article Hit count: 147

Filed under:
|

I want to use case in sql statement where clause but I have a problem as I want to create a where clause condition on the basis of some value and I want to set a not in clause values on the basis of it

here is the query where am facing an issue

WHERE CODE = 'x'  and 
   ID not in (
      case  
        when 'app'='A' then  '570','592'
        when  'Q' then ID 592,90
        else 592,90
      END

but its not syntax

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about sql-case