I'm assuming you're IDs are getting bigger, so how about ordering them in
descending order?

SELECT ID, title, article FROM news ORDER BY ID DESC LIMIT 2

Also, if you're starting from 0, you don't need to include that in the LIMIT
clause.

--jeff

----- Original Message -----
From: "Todd W" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 14, 2003 8:07 PM
Subject: Select newest records


> I am having troubles with queries, selecting only the newest records.
>
> Select ID,title,article From news ORDER BY ID LIMIT 0,2
>
> I tried this but it always shows the first two records and I want to
select
> the last two records(newest ones added).  Can someone help out?
>
> Thanks
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to