> -----Original Message----- > From: Mark [mailto:[EMAIL PROTECTED] > Sent: 06 November 2003 13:40 > To: [EMAIL PROTECTED]
> Using MySQL 3.23.58, what I want is to select the last 75 entries from a > table. Like so: > > "SELECT article_num FROM $table LIMIT 75" > > Except, of course, that this gives me the first 75, whereas I > need the last > 75. It sounds trivial; and it probably is, but I could not find it. > "article_num", by the way, is not necessarily sequentially numbered, so > doing something from X-75 to X, will not work. > You need to use the ORDER BY clause, and have a suitable field that ascends with each record. Perhaps something like: SELECT article_num FROM table ORDER BY article_num DESC LIMIT 75 or SELECT article_num FROM table ORDER BY id DESC LIMIT 75 assuming you have an ID field which is an auto increment value. - Barry -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]