ORDER BY Not allowed in Sub-Queries in Teradata

Teradata Error
Teradata Error
I am executing a query

INSERT INTO SAMPLES.CUST_NAMES;
SELECT A.NAME FROM SAMPLES.CUSTOMERS INNER JOIN
SAMPLES.ORDERS
ON A.CUST_CODE = B.CUST_CODE
WHERE B.ORDER_QTY BETWEEN 200 AND 300
ORDER BY A.NAME DESC;

The error is ORDER BY is not allowed.

Here, we are just inserting so ORDER BY is not required. It is useless.


Comments

Popular posts from this blog

SQL for Quantile Function in Teradata

3 Uses of SAMPLE function in Teradata

3 Types of Temporal Tables in Teradata