ALTER FUNCTION [dbo].[avgGpa]()
RETURNS decimal(3,2)
AS
BEGIN
DECLARE @CalcGPA decimal(10,2)
DECLARE @CalcGPA2 decimal(3,2)
SELECT @CalcGPA = SUM(cast(GPA AS decimal(10,2))) from dbo.Students
SELECT @CalcGPA2 = cast(ROUND((@CalcGPA / 1000),2) AS decimal(3,2))
RETURN @CalcGPA2
END
问问题
10372 次