Subject Re: [firebird-support] how to compare a value who comes from sub-select ref/eDN3012773479
Author Alexandre Benson Smith
dennis wrote:
> The problem is that the "rest" of the customer doesn't come from an easy
> outer join but from a procedure that takes some msec to compute it.
>
>
>
> I tried to work the procedure with outer join but was much slower from
> calling it like sub-select.
>
>
>
> Is there any way in where statement to get the value by column like Delphi
> expression: field[2].value ?
>
>
>
> Kind regards
>
> Dennis
>

So, your option is the first query I suggested, this one:

Select
Customer.name customer_name,
(select sum(rest) from movements where movements.customer=customer.code) entity_rest
from
Customer
Where
Customer.deleted=0 and
(select sum(rest) from movements where movements.customer=customer.code) <> 0


see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br