Re: A join of 2 tables with sum(column) > 30

From: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: A join of 2 tables with sum(column) > 30
Date: 2011-03-17 13:46:05
Message-ID: AANLkTi=sc+haUjchgHG7qnBvU3tF1uhVXYPgZWSdcp0n@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you all for the replies -

On Wed, Mar 16, 2011 at 3:05 PM, Igor Neyman <ineyman(at)perceptron(dot)com> wrote:
> Select id, sum(col1) from tab
> Where id > 10
> Group by id
> Having sum)col1) >30;
>
> Spend some time reading basic SQL docs/books - it'll help you
> tremendously.

I have already read many SQL-docs (really) and
I've done Perl, PHP, Java, C, ActionScript, etc. programming
at various points of time (for living AND/OR for fun)
and SQL is the most mind-boggling for me.

Regards
Alex

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guillaume Yziquel 2011-03-17 14:20:41 Startup messages for socket protocol
Previous Message bkwiencien 2011-03-17 12:24:47 pgwatch by Cybertec