All Forums Database
mithunk 7 posts Joined 02/13
14 Apr 2013
TOP vs QUALIFY RANK to fetch records

Which is the best option in means of performance ?
selecting rows using top clause without any order by clause (or)
selecting rows using qualify rank() over() =1 ?

dnoeth 4628 posts Joined 11/04
14 Apr 2013

Hi Mithun,
you can't use RANK without ORDER BY, so TOP will be more performant.
When you need an ordered output there will be no difference in speed.


jacobjonz 2 posts Joined 09/10
03 Dec 2014

First off, sorry for hitting an old thread.
The below link from teradata says that top n is better performing even in case of ordered output.
Do you think this is only from Version 14?

You must sign in to leave a comment.