Subject Re: [firebird-support] Help Group by
Author Martijn Tonies
> 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?

What Order_ID do you expect from a grouped
set of orders?

Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com