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

Operatore condizionale in SQL Where Clausola

Puoi farlo senza un caso:

SELECT  Team.teamID 
FROM    Team
WHERE   (@teamid = 0 AND Team.teamID > 0)
        OR (@teamid <> 0 AND Team.teamID = @teamid)