Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why subquery does not work in teradata?

Tags:

sql

teradata

I tried this

SELECT * 
FROM
( SELECT *
FROM mytable;
);

and this

SELECT * 
FROM
( SELECT *
FROM mytable
);

Why these simple queries do not execute in Teradata?

like image 516
Andrei Vasilev Avatar asked Nov 19 '13 23:11

Andrei Vasilev


1 Answers

@a_horse_with_no_name has pointed out clearly. It should be written like this.

SELECT * 
FROM
(
 SELECT *
FROM mytable
) as MY_TABLE;
like image 190
Santhosh Avatar answered Oct 14 '22 06:10

Santhosh