I want to use Default value column in GROUP BY. The default column is created in Select statement.
I have tried to use the default column value 'A' in group by(I know i cannot use the alias value).
This is what I have tried.
Select Name, 'A' as 'ID',SUM(Amount) FROM Customer
GROUP BY Name, 'A'
I am getting the following error message:
Msg 164, Level 15, State 1, Line 18 Each GROUP BY expression must contain at least one column that is not an >outer reference.