Here is the T-SQL code that I coded, which I imagined to work but didn't work:
DECLARE @Local nvarchar(20)
SET @Local = 'Yes'
SELECT
(CASE WHEN @Local = 'Yes' THEN ID ELSE COUNT(ID) END)
FROM myTable
Is there something I am doing wrong or is there any other way to do that?
Thanks.