Subject Re: [ib-support] sum(field) with subselect
Author Helen Borrie
At 02:22 PM 07-09-02 +0200, you wrote:
>Hello ib-support@yahoogroups.com!
>
>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);

When you need to have two cursors on one table, you have to alias the
table. Try
select sum(t1.Field) from Table t1 where t1.ID in (select first 2 t2.ID
from Table t2);

heLen