Re: referencing column aliases in select list

Поиск
Список
Период
Сортировка
От Seb
Тема Re: referencing column aliases in select list
Дата
Msg-id 87zlsaxm13.fsf@patagonia.sebmags.homelinux.org
обсуждение исходный текст
Ответ на referencing column aliases in select list  (Seb <spluque@gmail.com>)
Список pgsql-general
On Fri, 04 Apr 2008 00:35:01 -0400,
Colin Wetherbee <cww@denterprises.org> wrote:

[...]

> SELECT foo - bar AS baz FROM ( SELECT a.a + b.a AS foo, a.b + b.b AS
> bar FROM a JOIN b ON a.id = b.id ) AS subtable;

> Although, I'm not really sure that's The Right Way to do it.

Thanks Colin, yes, I thought about that, but things get nasty when you
have to do some other calculation with 'baz', with the output of that
and so on (as I'm facing in my real tables).  But this may really be the
best solution anyway.


Cheers,

--
Seb

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

Предыдущее
От: Colin Wetherbee
Дата:
Сообщение: Re: referencing column aliases in select list
Следующее
От: Greg Smith
Дата:
Сообщение: Re: simple update queries take a long time - postgres 8.3.1