Subject | Re: [ib-support] Using aliases in the same select clause |
---|---|
Author | Helen Borrie |
Post date | 2002-10-31T07:17:49Z |
Gerhardus,
can achieve some sort of output here like this:
select
estimator,
estimatedvalue,
estimatedtime,
estimatedvalue/estimatedtime as estimatedrate
from dar
If this is heading where you want to go, the next thing to attend to is
what you get as a result. For example, if both of the inputs to the
expression are integer types then you will get a downwardly truncated
integer output in Fb/IB 6. If either of the inputs is null you will get a
null result. If the divisor is 0 then you will get a runtime error
(divide_by_zero)....and so on...
heLen
>I will use a different example.This won't work because Test1 and Test2 are not inputs to the query. You
>
>select estimator,estimatedvalue as Test1,estimatedtime as
>Test2,(Test1/Test2) from dar
>
>The problem is Test1 and Test2 is unknown but they do not need to be.
can achieve some sort of output here like this:
select
estimator,
estimatedvalue,
estimatedtime,
estimatedvalue/estimatedtime as estimatedrate
from dar
If this is heading where you want to go, the next thing to attend to is
what you get as a result. For example, if both of the inputs to the
expression are integer types then you will get a downwardly truncated
integer output in Fb/IB 6. If either of the inputs is null you will get a
null result. If the divisor is 0 then you will get a runtime error
(divide_by_zero)....and so on...
heLen