Re: Variables in PostgreSQL? [was: Is my MySQL Gaining?]

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Variables in PostgreSQL? [was: Is my MySQL Gaining?]
Дата
Msg-id 20031229040235.GA4924@wolff.to
обсуждение исходный текст
Ответ на Variables in PostgreSQL? [was: Is my MySQL Gaining?]  (Casey Allen Shobe <cshobe@softhome.net>)
Список pgsql-general
On Sun, Dec 28, 2003 at 12:57:10 -0500,
  Casey Allen Shobe <cshobe@softhome.net> wrote:
>
> Ahh, I have seen those...but they're specific to psql, and if memory serves me
> correct I wasn't able to use the variables within queries, either.  I need
> something I can use over ODBC (within a single transaction, of course).
> These can sometimes solve problems that you can't seem to solve any other
> way, and other times can improve query response time *greatly* (say, by
> running a subquery once and assigning the result to a variable used 40 times
> in the final statement instead of running 40 subqueries).

You should be handle to this case by using the subselect query in the from
clause and then doing a join to make the value available where needed.

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

Предыдущее
От: Alex Satrapa
Дата:
Сообщение: Re: Is my MySQL Gaining ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_recvbuf errors