TOP and Order by


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)

Re: TOP and Order by

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