All Forums Teradata Studio
sagarsisodia 1 post Joined 12/11
19 Jul 2013
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. "

dnoeth 4628 posts Joined 11/04
19 Jul 2013

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

Dieter

You must sign in to leave a comment.