Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Come valutare un input nella clausola WHERE

 WHERE (@INPUT = 1 AND ITEMID IN (13,16)) 
    OR (@INPUT = 2 AND ITEMID IN (11,14))
    OR (@INPUT NOT IN (1,2) AND ITEMID = 0)