example query for postgresql

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: example query for postgresql
Date: 2008-01-19 18:22:46
Message-ID: 20080119192246.518488ed@webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2008-01-19 18:46:09 Re: WARNINGs after starting backup server created with PITR
Previous Message Tom Lane 2008-01-19 17:56:31 Re: WARNINGs after starting backup server created with PITR