Aliasing on tables ...

Поиск
Список
Период
Сортировка
От Hans-Jürgen Schönig
Тема Aliasing on tables ...
Дата
Msg-id 3ACDB582.A43B14B7@cybertec.at
обсуждение исходный текст
Список pgsql-sql
Is there any possibility to access a column using the alias for the
column in the where clause?
Queries like that don't seem to work:

SELECT name || ' bought ' || amount || ' units' AS result FROM sales
where
result='abc';
ERROR:  Attribute 'result' not found


That works perfectly well:
SELECT name || ' bought ' || amount || ' units' AS result FROM sales
where
name || ' bought ' || amount || ' units'='abc';

result
--------
(0 rows)


Is there any possibility to do this with PostgreSQL 7.0.3?
   Hans



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

Предыдущее
От: "comp"
Дата:
Сообщение: Sql error
Следующее
От: Richard
Дата:
Сообщение: pg_dump and oid