Subject | Re: [ib-support] sum(field) with subselect |
---|---|
Author | Helen Borrie |
Post date | 2002-09-07T14:45:40Z |
At 02:22 PM 07-09-02 +0200, you wrote:
table. Try
select sum(t1.Field) from Table t1 where t1.ID in (select first 2 t2.ID
from Table t2);
heLen
>Hello ib-support@yahoogroups.com!When you need to have two cursors on one table, you have to alias the
>
>Example:
>I need sum two rows in table, but those rows is returned from
>subselect.
>
>select sum(Field) from Table where ID in (select first 2 ID from Table);
table. Try
select sum(t1.Field) from Table t1 where t1.ID in (select first 2 t2.ID
from Table t2);
heLen