select id, product, min(price), store from tablename group by product
Better?
Regards
Chris
- Original Message -
From: "Ciprian Trofin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 28, 2002 1:24 PM
Subject: Re[2]: Join or smth.
> Doesn't work the way I want
I'm sure this question should be put in the docs. It's asked at least once a
fortnight. Welcome to the wonderful world of Mysql variables.
create temporary table productorder select *,(@a:= IF(@b=product,@a+1,1)) as
cnt, @b:=product from
products order by product,price;
mysql> select * from produ