TOP and Order by

Database
Fan

TOP and Order by

Hi all

I'm new to teradata I want to confirm about the order priority of the execution of the query.

Sample query

Select top n x_column, y_column, z_column from table_abc order by x_column desc;

for the above mentioned query what is the order priority of the execution.

Whether the query fetch top n records at  first and then execute order by or else order by execut first and then if fetches top n records..

Thanks in advance..

Tags (2)
1 REPLY
Enthusiast

Re: TOP and Order by

It would do the order by first and then fetch top n records.