Subject Re: [firebird-support] Help Group by
Author Alberto Pesce
I need to obtain a order identificator where cod_art it is at lower cost.

Thanks
bye

----- Original Message -----
From: "Martijn Tonies" <m.tonies@...>
To: <firebird-support@yahoogroups.com>
Sent: Wednesday, March 15, 2006 6:23 PM
Subject: Re: [firebird-support] Help Group by


>
>
> > 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
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>
>