Subject | Help Group by |
---|---|
Author | Alberto Pesce |
Post date | 2006-03-15T17:12:09Z |
I need to make this query:
the lower cost of product ordered for each oreder.
this work well
SELECT cod_art, MIN(cost)
FROM orders
GROUP BY cod_art
but this return each row in orders
SELECT order_ID, cod_art, MIN(cost)
FROM orders
GROUP BY order_ID, cod_art
How can I add order_ID in the first query?
Thanks
bye
[Non-text portions of this message have been removed]
the lower cost of product ordered for each oreder.
this work well
SELECT cod_art, MIN(cost)
FROM orders
GROUP BY cod_art
but this return each row in orders
SELECT order_ID, cod_art, MIN(cost)
FROM orders
GROUP BY order_ID, cod_art
How can I add order_ID in the first query?
Thanks
bye
[Non-text portions of this message have been removed]