[thelist] Quick SQL question

.jeff jeff at members.evolt.org
Mon Feb 10 15:24:01 CST 2003


austin,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Austin Govella
>
> I read the answers, but I don't understand why you
> couldn't just change the ORDER from DESC to ASC.
>
> In my logic (being familiar with basic SQL and sketchy
> beyond that), the TOP 15 gets the 15 highest numbers
> from the col_id (done in numbers). And the ORDER BY
> decides whether it goes from highest to lowest or vice
> versa.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

your understanding of what the TOP keyword does is incorrect.  the TOP
keyword simply tells the database to return x number of the first records
returned by the query.  so, to get the last 15 in a table, you have to use
TOP and ORDER BY DESC.

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/




More information about the thelist mailing list