erts on the mysql list than me) but
also
> for the benefit of others with a similar problem (although there is a
> rather
> big lag from posting to appearing on the list). The list archives also
> getting way to little attention.
>
>
> >
> >> -----Original Messa
On Tue, 2003-01-28 at 12:26, Christopher Lyon wrote:
> I am trying to do an sql query and am trying to select the last x rows
> from the database. I see the limit function but that seems like that is
> from the first row down. I want to start from the last row to the first
> row. So, selecting the
tention.
>
>> -Original Message-
>> From: R. Hannes Niedner [mailto:[EMAIL PROTECTED]]
>> Sent: Tuesday, January 28, 2003 11:50 AM
>> To: Christopher Lyon; MySQL Mailinglist
>> Subject: Re: sql query using select and row functions
>>
>> On
Pendleton; [EMAIL PROTECTED]
Subject: RE: sql query using select and row functions
I would think they would be the same no?
It turns out in the database that they are the same.
> -Original Message-
> From: Victor Pendleton [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 28
I would think they would be the same no?
It turns out in the database that they are the same.
> -Original Message-
> From: Victor Pendleton [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 28, 2003 12:23 PM
> To: Christopher Lyon; [EMAIL PROTECTED]
> Subject: RE:
Do you mean the last five rows in the database or the last five rows entered
into the database?
Either way,
Last five rows
select [someColumn]
from [someTable]
ORDER BY [someColumn] DESC
LIMIT 0, 5
If the total number of rows is known
select [someColumn]
from [someTable]
ORDER BY [someColum
Try ordering the records backwards, e.g ORDER BY id DESC and then limit 0, 5
HTH
JFernando
* sql *
-Original Message-
From: Christopher Lyon [mailto:[EMAIL PROTECTED]]
Sent: January 28, 2003 11:26
To: [EMAIL PROTECTED]
Subject: sql query using select and row functions
I am trying to do
On 1/28/03 8:26 AM, "Christopher Lyon" <[EMAIL PROTECTED]> wrote:
> I am trying to do an sql query and am trying to select the last x rows
> from the database. I see the limit function but that seems like that is
> from the first row down. I want to start from the last row to the first
> row. So,
Why not just reverse your order by clause and use Limit 5?
Mike Hillyer
-Original Message-
From: Christopher Lyon [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 28, 2003 9:26 AM
To: [EMAIL PROTECTED]
Subject: sql query using select and row functions
I am trying to do an sql query an