I got a distance
field in my database that stores the distance traveled on a specific route.
I need to select all the distance fields and plus them together, then returning the result from my stored procedure.
How can this be done?
I got a distance
field in my database that stores the distance traveled on a specific route.
I need to select all the distance fields and plus them together, then returning the result from my stored procedure.
How can this be done?
Something like this:
CREATE PROCEDURE SumDistances
AS
BEGIN
SELECT SUM(Distance)
FROM MyTable
END