All Forums Teradata Applications
rupert160 131 posts Joined 09/10
17 Oct 2010
RESET keyword in Teradata 12 Certification

Any ideas why this is going wrong people? The following command in the T12 course notes is causing a syntax error:

SELECT Month_Of_The_Year, Sales,
SUM( Sales ) OVER (
ORDER BY Month_Of_The_Year
RESET WHEN sales IS NOT NULL
ROWS UNBOUNDED PRECEDING ) AS Last_Non_Null_Sales
FROM monthly_sales;

--error 3707: expect something like ")" between "Month_Of_The_Year" and "RESET"

------------------fyi--------------------------------- -

CREATE VOLATILE TABLE monthly_sales
(
Month_of_the_Year INTEGER NOT NULL
, Sales INTEGER
)
ON COMMIT PRESERVE ROWS;

INSERT INTO monthly_sales VALUES (1,4500);
INSERT INTO monthly_sales VALUES (2,4550);
INSERT INTO monthly_sales VALUES (3,4250);
INSERT INTO monthly_sales VALUES (4,4225);
INSERT INTO monthly_sales VALUES (5,NULL);
INSERT INTO monthly_sales VALUES (6,5124);
INSERT INTO monthly_sales VALUES (7,NULL);
INSERT INTO monthly_sales VALUES (8,5500);
INSERT INTO monthly_sales VALUES (9,4750);
INSERT INTO monthly_sales VALUES (10,4850);
INSERT INTO monthly_sales VALUES (11,5000);
INSERT INTO monthly_sales VALUES (12,5200);

SEL * FROM monthly_sales;

SELECT Month_Of_The_Year, Sales,
SUM( Sales ) OVER (
ORDER BY Month_Of_The_Year
RESET WHEN sales IS NOT NULL
ROWS UNBOUNDED PRECEDING ) AS Last_Non_Null_Sales
FROM monthly_sales;

--error 3707: expect something like ")" between "Month_Of_The_Year" and "RESET"

dnoeth 4628 posts Joined 11/04
17 Oct 2010

It's not from the TD12 course notes, this is TD13 syntax :-)

Dieter

Dieter

rupert160 131 posts Joined 09/10
17 Oct 2010

This looks like an error in the online course then. In the ordered analytic functions it's one of the last topics. Shall I submit a bug request dnoeth?

dnoeth 4628 posts Joined 11/04
18 Oct 2010

If this a TD12 course, then it's a bug.

Dieter

Dieter

black7mt 3 posts Joined 12/10
28 Dec 2010

I had the same problem and it is now solved
________________
Read reviews of the http://www.moneytoplist.com affiliate programs and earn residual commissions

n.u.kumar 1 post Joined 05/11
29 Oct 2011

hi rupert,

the syntax works very well in TERADATA 13.

So its not a error just nt compatible with earlier versions of teradata.

 

You must sign in to leave a comment.