He need 10 last records ordered by id.

You also can try this
SELECT  *,count(*) as c FROM item GROUP BY ID LIMIT c-10,10
or
SELECT  *,count(*)-10 as c FROM item GROUP BY ID LIMIT c,10

Something should work

----- Original Message -----
From: Scott Gerhardt <[EMAIL PROTECTED]>
To: Rus <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 31, 2001 12:40 AM
Subject: RE: How to select the 10 last items from a table?


> SELECT * FROM item
> ORDER BY ID
> LIMIT 10
>
> or change to "ORDER BY ID DESC" to get the desired result.
>
> - Scott
>
> > May be it could work
> > SELECT  * FROM item ORDER BY ID LIMIT count(*)-10,10
> > or
> > SELECT  * FROM SELECT  * FROM item ORDER BY ID DESC LIMIT 10 ORDER BY ID
> >
> >
> >
> >
> > ----- Original Message -----
> > From: Karlsson Andreas-andkar01 <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 30, 2001 6:00 PM
> > Subject: How to select the 10 last items from a table?
> >
> >
> > Hi,
> > I have a table were all rows have their own ID. How can I select only
the
> > last items out of this table?
> > This command fixes it but I receive the items in the wrong order that I
> > would like them...
> > SELECT * FROM item ORDER BY ID DESC LIMIT 10
> > brgds
> > Andreas
> >
> > Andreas Karlsson
> > MAGNET- Motorola Applications Global Network
> > Campus Gräsvik 2
> > 371 75 Karlskrona
> > Phone: +46-455-379 306
> > E-mail:[EMAIL PROTECTED]
> > ____________________________________________
> > Become a MAGNET member - register at:
> > http://www.motorola.com/developers/wireless/
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
>
>
> ---------------------------------------------------------------------
> 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