I was able to sort a query using
GROUP BY ACADEMIC_PERIOD, 'Total', COLLEGE
ORDER BY 1, 2, DECODE (COLLEGE,'LA', 1, 'SC', 2, 'BN', 3, 'NS', 4, 'PS', 5);
However, when I changed the query to a union and moved the decode statement to the last line of the query, this no longer worked. "ORA-01785: ORDER BY item must be the number of a SELECT-list expression. Error at Line:30 Column:15"
Any suggestions on changing the sort without making the calculated field visible on the results.
The purpose of the union was to show two different groups and then union that with another query to provide the totals for the two groups.
GROUP BY ACADEMIC_PERIOD, 'Total', COLLEGE
ORDER BY 1, 2, DECODE (COLLEGE,'LA', 1, 'SC', 2, 'BN', 3, 'NS', 4, 'PS', 5);
However, when I changed the query to a union and moved the decode statement to the last line of the query, this no longer worked. "ORA-01785: ORDER BY item must be the number of a SELECT-list expression. Error at Line:30 Column:15"
Any suggestions on changing the sort without making the calculated field visible on the results.
The purpose of the union was to show two different groups and then union that with another query to provide the totals for the two groups.