Subject | Re: [firebird-support] Rroblem with 'group by' |
---|---|
Author | Alexandre Benson Smith |
Post date | 2004-07-16T21:28:24Z |
uwekeim wrote:
If your query is simple as you showed us, the group by will do the same
job as a distinct, as you don't have any agregate function on it
Try this:
SELECT disctinct SOMETHING, colA*colB as PRICE
FROM PRICES
In FB 1.5 you could group by column number (the index of a column)
SELECT SOMETHING, colA*colB as PRICE
FROM PRICES
GROUP BY SOMETHING, 2
But I still thinks distinct are what you want.
see you !
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br
>Hello,Uwe,
>
>we're switching from Paradox to Firebird. Unfortunately we must use
>dialect 1.
>
>Now we have this problem:
>
>--->
>
>SELECT SOMETHING, colA*colB as PRICE
>FROM PRICES
>GROUP BY SOMETHING, colA*colB as PRICE
>
><---
>
>does not work. I've tried several variations, but didn't find a
>solution.
>
>Is there any way to solve this problem?
>
>kind regards
>Uwe Keim
>
>
If your query is simple as you showed us, the group by will do the same
job as a distinct, as you don't have any agregate function on it
Try this:
SELECT disctinct SOMETHING, colA*colB as PRICE
FROM PRICES
In FB 1.5 you could group by column number (the index of a column)
SELECT SOMETHING, colA*colB as PRICE
FROM PRICES
GROUP BY SOMETHING, 2
But I still thinks distinct are what you want.
see you !
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br