Forum Discussion
Incorrect Result Set
- Jan 13, 2024
The results are correct because you are using an aggregate function, which allows the 'Test' literal to generate a result set row that just happens to have a NULL value for the aggregate result.
If you were not performing an aggregation - as shown in the following example, you would get no rows (which is what you seem to have incorrectly expected for the aggregate scenario).
SELECT 'Test', * From @Temp;
Cheers,
Lain
The results are correct because you are using an aggregate function, which allows the 'Test' literal to generate a result set row that just happens to have a NULL value for the aggregate result.
If you were not performing an aggregation - as shown in the following example, you would get no rows (which is what you seem to have incorrectly expected for the aggregate scenario).
SELECT 'Test', * From @Temp;
Cheers,
Lain