jmoya 0 Newbie Poster

Why is the result of this query..

SELECT * FROM (SELECT TOP 5 * FROM          
(SELECT TOP 20 * FROM ODPSEnrlAccts ORDER BY fld_acctname) AS foo
ORDER BY fld_acctname DESC) as bar ORDER BY fld_acctname DESC

Is the same as the result of this one..

SELECT TOP 5 * FROM          
(SELECT TOP 20 * FROM ODPSEnrlAccts ORDER BY fld_acctname) AS foo
ORDER BY fld_acctname DESC) as bar

Im really confused because i need the result in ascending order. I know I can do that programmatically but it will definitely show some performance decrease.

Im using SQL 7 on my computer. Help please..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.