|
|
 |
Re: FN-FORUM: Mysql syntax help
date posted 1st May 2008 15:49
Quoting Nigel Rogers [EMAIL REMOVED]
>
> Hi, I think this is a simple question:
>
>
> I have a simple query that requests the 3 most recent album entries
> from a mysql database
>
> $maxRows_Albums = 3;
>
>
> which i order by recent first...
>
> $query_Albums = "SELECT * FROM albumlist ORDER BY id DESC";
>
>
> is there a way to order them whilst omitting the single most recent
> entry ie
>
> 2,3,4 rather than 1,2,3
>
Simplest way would be
"SELECT * FROM albumlist WHERE id>1 ORDER BY 1 DESC LIMIT 3";
That will get you the albums where id is greater than 1 (or whatever)
and limited to three rows.
Alex
http://www.ozbon.com
|
 |
|