[thelist] Quick SQL question

Rob Smith rob.smith at THERMON.com
Mon Feb 10 15:51:01 CST 2003


Yes. Thanks .jeff for the correct solution. This string :-) (laughing in the
background) reminds me of the, "How many evolters does it take to change a
tire (respond to a message)" message. Those of you who know what I'm talking
about will find that amusing too. I'm sure someone will chime in with the
link to the article.

<tip type="Safety Nets are a Good Thing" author="Rob.Smith">
Recently I've had the pleasure of doing some interesting forms with lots and
lots of fields. Since there were so many things that could go wrong,
Murphy's Law should prevail. It did...and it backfired on Murphy.

I implemented a SQL table and query, my safety net, that would record
everything the user entered before it got parsed, tweaked, emailed, and so
on. I was able to save 2 (out of 2) of the forms that were "submitted" that
never reached its recipient; a sales rep. Because of this, I had a chance to
go back and fix my errors. It seems that I hadn't planned for every
contingency, and all I have to say is that Safety Nets are a Good Thing.
</tip>

Rob.Smith

-----Original Message-----
From: .jeff [mailto:jeff at members.evolt.org]
Sent: Monday, February 10, 2003 3:18 PM
To: thelist at lists.evolt.org
Subject: RE: [thelist] Quick SQL question


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/

--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !



More information about the thelist mailing list