Subject Re: [ib-support] Re: Newbie question IB about select
Author Woody
> Hi Woody,
>
> >
> > Select MaterialType, MaterialSize1, MaterialSize2, sum(MaterialWgt),
> > sum(MaterialWgt * MaterialCost) from Materials
> > Group by MaterialType, MaterialSize1, MaterialSize2
> >
> > In what way would you change the query not to use non-aggregate columns?
> > Woody (TMW)
>
> What are you getting at? All of your resulting columns are aggregated ...

Is not the definition of an aggregate column one whose value is computed?
The above doesn't compute the material type or size, only the combined
weight and cost. In IB (and FB I believe) the SQL rules state that to use
Group By in an aggregate query, you must include all non-aggregate columns,
right?


>
> It's not me who made the SQL rules, you know :)
>

Sure, blame someone else... <VBG>

Woody (TMW)

----------------------
"To invent, you need a good imagination and a pile of junk."
Thomas Edison