Subject Re: [firebird-support] please help with group by and subselect
Author Milan Babuskov
Helen Borrie wrote:
> Will this do?
>
> select
> a.supplier,
> a.last_quoted_price,
> a.last_quote_date
> from pricelist a
> where a.last_quote_date = (
> select max(b.last_quote_date) from pricelist b
> where b.supplier = a.supplier
> and b.product = a.product)
> where a.product = :product

If he has more than one record for same quote_date/suplier/product, he
will get all of those. Perhaps to add "distinct" after select?

--
Milan Babuskov
http://fbexport.sourceforge.net