Subject | Re: [ib-support] "token unknown 'order' " |
---|---|
Author | Helen Borrie |
Post date | 2002-04-28T12:42:09Z |
At 11:10 AM 28-04-02 +0200, you wrote:
I'm not Firebird, but I can't work out what on earth are you trying to
achieve here. At a guess, I'd say you want to aggregate the totals by
d_mov - in which case, simply include d_mov and use it to GROUP BY:
select d_mov, sum(qty) as TotalQty
from mv_li
GROUP BY d_mov
Helen
All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________
>I want to add (the field qty of all) the most recent records.It doesn't speak FoschiQL!
>
>d_mov is the field that contains the date.
>
>What I am trying to say is "sum field qty in table mv_li where the date has
>the most recent value
>
>select sum(a.qty) from mv_li a
>where a.d_mov=(select first 1 b.d_mov from mv_li b
>order by b.d_mov desc)
>
>If I were Firebird, I would understand at once what to compute :)
>
>What's wrong with FB ?
I'm not Firebird, but I can't work out what on earth are you trying to
achieve here. At a guess, I'd say you want to aggregate the totals by
d_mov - in which case, simply include d_mov and use it to GROUP BY:
select d_mov, sum(qty) as TotalQty
from mv_li
GROUP BY d_mov
Helen
All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________