On Fri, 14 Jun 2002 chris(dot)gamble(at)CPBINC(dot)com wrote:
> Is it possible to define the following in language='SQL' ?
>
> select (69.1 * $1 - $2) as x, (53 * $3 - $4) as y;
> select sqrt(x * x + y * y) as distance;
>
> I was trying to create this but keep getting the error that x does not
> exist...
I don't think you can do it as the above, but for the simple
example above, you can probably make it one query with a
subselect in from.
select sqrt(x*x+y*y) as distance from
(select (69.1 * $1 - $2) as x, (53 * $3 - $4) as y) as foo;