How can I embed a WITH clause into a SELECT statement in Teradata 13.10?

Database
Enthusiast

How can I embed a WITH clause into a SELECT statement in Teradata 13.10?

More precisely: I want to use a WITH clause in a stored procedure's "SELECT ... INTO :variable FROM..." statement.

...
DECLARE violatedRowsCount INTEGER;

SELECT COUNT(*) INTO :violatedRowsCount
FROM ( <_here_> ) AS TBL;
...

Is it possible? If yes, how?

Thanks!

1 REPLY

Re: How can I embed a WITH clause into a SELECT statement in Teradata 13.10?

with subqr AS ( 

select * from table

)

select * from subqr