我想要group by子句的默认值。
我尝试使用以下查询但未获得成功
SELECT ISNULL(MAX(Sum(points)),0)
FROM Table1
group by PanelistID having PanelistID = 4310497
请完整
答案 0 :(得分:1)
SELECT 4310497 AS some, ISNULL(MAX(Sum(points)),0)
FROM Table1
WHERE PanelistID = 4310497
GROUP BY PanelistID
您可以在SELECT CLAUSE中插入常量值,它不会对GROUP CLAUSE
产生影响