他の列を含める場合は、GROUP BY 句も含める必要があります
SELECT AnotherColumn, SUM(DATEDIFF(day, StartDate, EndDate)+1) AS myTotal
FROM myTable
WHERE (Reason = '77000005471247')
GROUP BY AnotherColumn
他の列を含める場合は、GROUP BY 句も含める必要があります
SELECT AnotherColumn, SUM(DATEDIFF(day, StartDate, EndDate)+1) AS myTotal
FROM myTable
WHERE (Reason = '77000005471247')
GROUP BY AnotherColumn