I have the following tables:
EMPLID=INTEGER, F_NAME=VARCHAR, M_NAME=VARCHAR, SALARY_GRADE_ID=VARCHAR
GRADE_ID=VARCHAR, GRADE_AMOUNT=INTEGER
My query:
SELECT L_Name, Grade_Amount, CAST(AVG(Grade_Amount) AS DECIMAL(0,2)) AS "Total by Last Name" FROM
Employee INNER JOIN Salary_Grades ON Employee.Salary_Grade_id = Salary_Grades.Grade_Id
GROUP BY L_Name, Grade_Amount;
Is met with the error:
SQL compilation error: invalid data type specification (2>0)
When I set the decimal specification to (2,2), the query generates the error
Number out of representable range: type FIXED[SB1]{nullable}, value 70000.000000
What is actually happening here? What is wrong with the CAST() statement?

