PDA

View Full Version : Simple MySQL Problem


ccole
04-04-2002, 11:58 PM
I'm still a little new at MySQL. What I want to do is get only the first 15 entries, ordered by the column 'date', but going descending.

I can do it without descending:
SELECT * FROM `table` ORDER BY `Date` ASC LIMIT 0, 15

I can do descending without the limit:
SELECT * FROM `table` ORDER BY `Date` DESC

But they don't seem to want to go together. Got an answer anybody?

ccole
04-06-2002, 02:14 PM
Well, I figured it out. I had on ASC without even realizing, dumb me. The final code looks like this:

SELECT * FROM `table` ORDER BY `Date` DESC LIMIT 0, 15