Subject | RE: [firebird-support] how to compare a value who comes from sub-select ref/eDN3012773479 |
---|---|
Author | dennis |
Post date | 2007-07-30T14:21:42Z |
Hello Anderson and Alexander
The problem is that this sub-select makes some time delay, if in the where
statement I recall this sub-select the entire query takes the double time on
execution. On hard database dig the query will be delayed by 2.
Does any body knows if this happening on ms-sql and on oracle?
After this discussion I think that the better approach is to make a
procedure for the "rest", to get the result as variable from "select"
statement, where then the variable will be callable from the where statement
:-(.
Take care
Dennis
_____
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Alexandre Benson
Smith
Sent: Friday, July 27, 2007 7:04 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] how to compare a value who comes from
sub-select ref/eDN3012773479
dennis wrote:
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
[Non-text portions of this message have been removed]
The problem is that this sub-select makes some time delay, if in the where
statement I recall this sub-select the entire query takes the double time on
execution. On hard database dig the query will be delayed by 2.
Does any body knows if this happening on ms-sql and on oracle?
After this discussion I think that the better approach is to make a
procedure for the "rest", to get the result as variable from "select"
statement, where then the variable will be callable from the where statement
:-(.
Take care
Dennis
_____
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Alexandre Benson
Smith
Sent: Friday, July 27, 2007 7:04 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] how to compare a value who comes from
sub-select ref/eDN3012773479
dennis wrote:
> The problem is that the "rest" of the customer doesn't come from an easySo, your option is the first query I suggested, this one:
> 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
>
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
[Non-text portions of this message have been removed]