I have a very simple SQL Query which is getting results in the following way
COL-A COL-B
WINDCHILL 99.998889
WINDCHILL 96.000000
Now how i can modify my query so that I get the total in a single line?
COL-A COL-B
WINDCHILL 195.99
The necessary query is as;
SELECT ISNULL([Task IT Assets], [Project IT Asset]) AS Asset ,
SUM(P.ActualWork) AS taskHours
FROM [IR.TimesheetHoursProjectTask] p
WHERE p.ActualWork > 0
AND ([Task IT Assets] IS NOT NULL OR [Project IT Asset] IS NOT NULL)
GROUP BY ISNULL([Task IT Assets], [Project IT Asset]), ActualWork
ORDER BY p.ActualWork DESC
I think the problem is that you shouldn’t have
ActualWorkin yourGROUP BYclause.Try this instead: