Friday, 13 February 2015

ORDER BY Not allowed in Sub-Queries in Teradata

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.


No comments:

Post a Comment