Total and Subtotal Aggregate Function not working

Teradata Studio

Total and Subtotal Aggregate Function not working

Teradata Studio not able to run simple aggregation function.

Sample SQL

SELECT department_number AS Dept

,job_code AS Job

,employee_number AS Empl

,salary_amount AS Sal

FROM employee

WHERE department_number IN (401, 501)

WITH SUM (salary_amount) (TITLE 'Job Total') BY Job

WITH SUM (salary_amount) (TITLE 'DEPT TOTAL') BY Dept;

Below is the error msg

"Executed as Single statement.  Failed [1005 : HY000] Unexpected parcel kind received: 33 

Elapsed time = 00:00:01.110 

STATEMENT 1: Select Statement failed. "

1 REPLY
N/A

Re: Total and Subtotal Aggregate Function not working

This is no simple aggregation, the WITH aggregate syntax returns rows plus intermediate aggregates.

It's only supported in a REPORT run in BTEQ.

Dieter