I am using the same table and columns for both queries, but I have different aliases and avg function. How would I be able to combine these two queries with UNION ALL because I want every single row that I have selected from them. Obviously I can't do it when I have different select statements. How could I combine these two queries ?
SELECT GRADE_TYPE_CODE, ROUND(TO_CHAR(NUMERIC_GRADE),2) AS GRADE
FROM GRADE
WHERE STUDENT_ID = 10 AND SECTION_ID = 5
ORDER BY GRADE_TYPE_CODE DESC,NUMERIC_GRADE DESC;
SELECT 'Average is:' AS GRADE_TYPE_CODE,AVG(GRADE) AS GRADE
FROM
(
SELECT AVG(NUMERIC_GRADE) AS GRADE
FROM GRADE
WHERE STUDENT_ID = 10 AND SECTION_ID = 5
GROUP BY GRADE_TYPE_CODE
) myInnerTable;