That'd be the solution, but unfortunately i gave You incorrect example (too
little rows):
the problem is I don't have a constant number of foods. For example the
latest price of tomatoes could be from day 20 but the last price of potatoes
might be from day 19, and for onions from day 1. I need single most recent
row for each type of food that has appeared in database.

----- Original Message -----
From: "Becoming Digital" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 02, 2003 12:28 AM
Subject: Re: SELECTing last occurences from a table


> Do you have daily prices for a set number number of foods?  If so, try
>
> SELECT * FROM food
>     LIMIT n,-1;
>
> where n is the number of items.  There's probably a better way to do it in
SQL,
> I just don't know how.  If you are using PHP, that's another story.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to