Re: example query for postgresql

Поиск
Список
Период
Сортировка
От Sim Zacks
Тема Re: example query for postgresql
Дата
Msg-id fmutej$hg0$1@news.hub.org
обсуждение исходный текст
Ответ на example query for postgresql  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Ответы planner and simple vs. complex statement was: example query for postgresql  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Список pgsql-general
I've found that multiple simple statements often work faster then convoluted single statements.



Ivan Sergio Borgonovo wrote:
> Is there a place that gives examples of all the kind of queries
> postgresql support?
>
> Sometimes I think if there is a way to obtain a result in just one
> statement without writing a function and it would be nice to have a
> panoramic of all the strategies I could try for single statements.
>
>
> The SQL reference
> http://www.postgresql.org/docs/8.1/interactive/sql-commands.html
> isn't inspirational every time
>
> Even if it is not exactly what I'm looking for a sort of "one liner"
> as the one you find for perl, sed, awk...
>
> As an example of things the kind of things I'm looking for:
>
> update system
>   set weight=subselect._avg
>   from (
>     select round(avg(weight)) as _avg
>     from system where type='module'
>   ) as subselect
>   where name='users_commerce';
>
>
> thx
>

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

Предыдущее
От: Sim Zacks
Дата:
Сообщение: Re: plpythonu
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: WARNINGs after starting backup server created with PITR