Hi,
What is wrong with this syntax? I want to name the column in the case for use in the #temp table but doesn't seem to like it.
SELECT 'name',
CASE
WHEN ptno IN (99) THEN SUM (recno) 'a'
WHEN ptno IN (13) THEN SUM (recno) 'b'
END
INTO #temp
from myTable
error:
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near 'a'.
Thank you
What is wrong with this syntax? I want to name the column in the case for use in the #temp table but doesn't seem to like it.
SELECT 'name',
CASE
WHEN ptno IN (99) THEN SUM (recno) 'a'
WHEN ptno IN (13) THEN SUM (recno) 'b'
END
INTO #temp
from myTable
error:
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near 'a'.
Thank you