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

Поиск
Список
Период
Сортировка
От Stephen Howard
Тема referring to computed values from the select list in the where and order clauses
Дата
Msg-id 40428C13.8070804@thunkit.com
обсуждение исходный текст
Ответы Re: referring to computed values from the select list in the where and order clauses
Список 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



В списке pgsql-general по дате отправления:

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: count(1) return 0?
Следующее
От: Klint Gore
Дата:
Сообщение: Re: count(1) return 0?