example query for postgresql - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject example query for postgresql
Date
Msg-id 20080119192246.518488ed@webthatworks.it
Whole thread Raw
Responses Re: example query for postgresql
Re: example query for postgresql
Re: example query for postgresql
List 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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: WARNINGs after starting backup server created with PITR
Next
From: Simon Riggs
Date:
Subject: Re: WARNINGs after starting backup server created with PITR