SELECT product.*, productprice.*, productidmax.*
FROM product, productprice, (SELECT prodcode, MAX(prodpriceid) prodpriceid FROM productprice GROUP BY prodcode) productidmax
WHERE product.prodcode = productprice.prodcode AND productprice.prodpriceid = productidmax.prodpriceid AND product.prodcode = productidmax.prodcode
|