"Fernando Hevia" <[EMAIL PROTECTED]> writes:
> -- In this case function test is called only once:
> pg=# select res[0] as sum, res[1] as prod, res[2] as dif from
> pg-# (select (test(1, 2))::integer[] as res) t ;
That's an implementation artifact, not a guaranteed behavior;
if you change the examp
> > -Mensaje original-
> > De: Scott Marlowe [mailto:[EMAIL PROTECTED] Enviado el:
> > MiƩrcoles, 18 de Junio de 2008 17:47
> > Para: Fernando Hevia
>
> > >
> > > For complex calculations I have obtained better performance using
> > > nested queries. For example:
> > >
> > > select a,
> -Mensaje original-
> De: Scott Marlowe [mailto:[EMAIL PROTECTED]
> Enviado el: MiƩrcoles, 18 de Junio de 2008 17:47
> Para: Fernando Hevia
> >
> > For complex calculations I have obtained better performance using
> > nested queries. For example:
> >
> > select a, b, c select
> > ( s
ara: pgsql-sql@postgresql.org
>> Asunto: [SQL] using calculated column in where-clause
>>
>> Hi!
>>
>> I'd like to do some calculation with values from the table,
>> show them a new column and use the values in a where-clause.
>>
>> Something lik
> -Mensaje original-
> De: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] En nombre de Patrick
> Scharrenberg
> Enviado el: Martes, 17 de Junio de 2008 17:46
> Para: pgsql-sql@postgresql.org
> Asunto: [SQL] using calculated column in where-clause
>
> H
Andreas Kretschmer wrote:
>> Do I have to repeat the calculation (which might be even more complex
> yes.
Short and pregnant! :-)
Thanks!
Patrick
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
On Tue, Jun 17, 2008 at 2:46 PM, Patrick Scharrenberg <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I'd like to do some calculation with values from the table, show them a
> new column and use the values in a where-clause.
>
> Something like this
> select a, b , a*b as c from ta where c=2;
>
> But postgresq
Patrick Scharrenberg <[EMAIL PROTECTED]> schrieb:
> Something like this
> select a, b , a*b as c from ta where c=2;
>
> But postgresql complains, that column "c" does not exist.
>
> Do I have to repeat the calculation (which might be even more complex
yes.
Andreas
--
Really, I'm not out to de
Hi!
I'd like to do some calculation with values from the table, show them a
new column and use the values in a where-clause.
Something like this
select a, b , a*b as c from ta where c=2;
But postgresql complains, that column "c" does not exist.
Do I have to repeat the calculation (which might b