Quick SQL Question

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
ibanez270dx
Forum Commoner
Posts: 74
Joined: Thu Jul 27, 2006 12:06 pm
Location: Everywhere, California

Quick SQL Question

Post by ibanez270dx »

Hi,
I was wondering how I would be able to reverse the order of an SQL select... For example, if you select stuff from your table and order by the ID number, then it will go from smallest to largest (I.E. 0 - 100). How can I reverse that to make it order from largest to smallest?

Thanks,
- Jeff
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.
klarinetking
Forum Commoner
Posts: 59
Joined: Mon Jul 24, 2006 9:43 am

Post by klarinetking »

Hi,

Add on 'ORDER BY `fieldname` ASC/DESC'

klarinetking
ibanez270dx
Forum Commoner
Posts: 74
Joined: Thu Jul 27, 2006 12:06 pm
Location: Everywhere, California

Post by ibanez270dx »

thanks!
Post Reply