Skip site navigation (1) Skip section navigation (2)

referring to computed values from the select list in the where and order clauses

From: Stephen Howard <stephen(at)thunkit(dot)com>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: referring to computed values from the select list in the where and order clauses
Date: 2004-03-01 01:04:19
Message-ID: 40428C13.8070804@thunkit.com (view raw or flat)
Thread:
Lists: pgsql-general
I've got a moderately complex function defined which i then want to be

able to test the value of, as well as select the value:

select id, vector_cosine(document,'[ qw( foo,bar,baz )]') as threshold 
from search_vectorspace where threshold > 0 order by threshold desc;

I've tried it both with and without an AS alias, but in both instances 
pgsql complains that the column does not exist.  I would like to be able 
to use the value computed with out having to recompute it every place i 
wish to  use the value.  I've not had much luck finding this information 
in the Postgres documentation.  Anyone know what syntax i should be using?

thanks,
Stephen



Responses

pgsql-general by date

Next:From: Klint GoreDate: 2004-03-01 01:13:07
Subject: Re: count(1) return 0?
Previous:From: Bill MoranDate: 2004-03-01 01:02:40
Subject: Re: count(1) return 0?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group