using calculated column in where-clause

Поиск
Список
Период
Сортировка
От Patrick Scharrenberg
Тема using calculated column in where-clause
Дата
Msg-id 48582290.6050402@web.de
обсуждение исходный текст
Ответы Re: using calculated column in where-clause  (Andreas Kretschmer <akretschmer@spamfence.net>)
Re: using calculated column in where-clause  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Re: using calculated column in where-clause  ("Fernando Hevia" <fhevia@ip-tel.com.ar>)
Список pgsql-sql
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 be even more complex
:-) ) in the "where"-clause, or is there a better way?


Thanks in advance.

Best regards
Patrick


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

Предыдущее
От: TJ O'Donnell
Дата:
Сообщение: cool code_swarm animation of PostgreSQL development since 1996
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: using calculated column in where-clause