Subject Re: [ib-support] [OT ?] sql question
Author Daniel Rail
At 21/11/2002 05:20 PM, you wrote:
> >>
>select custID, sum(price*qty) from mv_li where op='PURCHASE' group by
>custID
> >>
>
>The final touch would be to get the list ordered by the purchase
>total, so that customers are ordered by their "weight".
>
>How do I do that ?
>
>I cannot add
>
>...order by sum(price*qty)

Try:
order by 2

Where 2 refers to the second field in the result set, which in your case is
"sum(price*qty)".


Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.accramed.ca)