Subject Re: [firebird-support] ORDER BY in Interbase vs Firebird
Author Woody
mthendley wrote:
> Interbase allowed the following query:
> SELECT SUM(ind_MoneyCollected)
> FROM ProductQty PQ RIGHT JOIN
> (InvoiceMaster IM JOIN InvoiceDetail ID ON ID.InvoiceMaster_ID =
> IM.InvoiceMaster_ID AND ID.ind_Status <> 2 AND
> IM.inm_TimeOut >=
> :BeginDate AND IM.inm_TimeOut < :EndDate)
> ON ID.ProductQty_ID = PQ.ProductQty_ID
> JOIN Product P ON PQ.Product_ID = P.Product_ID
> WHERE P.ProductLine_ID = 11
> ORDER BY InvoiceMaster_ID
>
> Firebird does not allow this because InvoiceMaster_ID is not in either
> select list or aggregate function. But I do not want it in my select
> list because I cannot have it in my GROUP BY clause. Any suggestions
> to make this work with Firebird?
> Thanks
>

Why would you want to order by a calculation that only returns one
result? Of what use could it be?

Woody (TMW)