> > -Original Message-
> > From: chris.el...@shropshire.gov.uk
> > [mailto:chris.el...@shropshire.gov.uk]
> > Sent: Monday, February 01, 2010 4:08 AM
> > To: neilst...@yahoo.com
> > Cc: pgsql-general@postgresql.org
> > Subject: Re: combine SQL SELECT statements into one
> >
> >
> > Hi
On Mon, Feb 1, 2010 at 12:09 PM, Igor Neyman wrote:
> Original poster asked for the sql that will touch inventory table only
> once.
>
> Your statement (with 3 subqueries) will do it 3 times.
I'm pretty sure that starting with 8.3 the engine will collapse all
those into one seq scan internally.
> -Original Message-
> From: chris.el...@shropshire.gov.uk
> [mailto:chris.el...@shropshire.gov.uk]
> Sent: Monday, February 01, 2010 4:08 AM
> To: neilst...@yahoo.com
> Cc: pgsql-general@postgresql.org
> Subject: Re: combine SQL SELECT statements into one
>
>
> Hi
>
> pgsql-genera
On Sun, Jan 31, 2010 at 11:36:55PM -0800, Neil Stlyz wrote:
> SELECT COUNT(distinct model) FROM inventory WHERE modified >= '2010-02-01';
> SELECT COUNT(distinct model) FROM inventory WHERE modified >= '2010-01-20';
> SELECT COUNT(distinct model) FROM inventory WHERE modified >= '2010-01-01';
>
> A
Hi
pgsql-general-ow...@postgresql.org wrote on 02/01/2010 07:36:55 AM:
> Good Evening, Good Morning Wherever you are whenever you may be reading
this.
>
>
snip
>
> count1 | count2 | count3
> ---
> 2 2 4
>
> Can this be done wi
Hi,
If I were you, I worked like this.
First make a union of those three query
Then make a crosstab :
http://www.postgresonline.com/journal/index.php?/archives/14-CrossTab-Queries-in-PostgreSQL-using-tablefunc-contrib.html
documented here :
http://www.postgresql.org/docs/8.4/interactive/tablefunc
Good Evening, Good Morning Wherever you are whenever you may be reading this.
I am new to this email group and have some good experience with SQL and
PostgreSQL database.
I am currently working on a PHP / PostgreSQL project and I came upon something
I could not figure out in SQL. I was wonderi