Re: aggregate function ? - Mailing list pgsql-novice

From Richard Broersma Jr
Subject Re: aggregate function ?
Date
Msg-id 785096.65866.qm@web31810.mail.mud.yahoo.com
Whole thread Raw
In response to Re: aggregate function ?  (Raimon Fernandez <coder@montx.com>)
Responses Re: aggregate function ?
List pgsql-novice
If all else fails, look for the answer on google:
http://www.sqlteam.com/item.asp?ItemID=3856

aparently "ON A1.oid <= A2.oid" should have been:
"ON A1.oid >= A2.oid".


    SELECT A1.oid, A1.concepte, A1.deure, A1.haver,
           sum( COALESCE( A2.deure, 0 ) -
                COALESCE( A2.haver, 0 )) AS value_sum
      FROM Assentaments AS A1
INNER JOIN Assentaments AS A2
        ON A1.oid >= A2.oid
       AND A1.numero = A2.numero
     WHERE A1.numero=11189
  GROUP BY A1.oid, A1.concepte, A1.deure, A1.haver
  ORDER BY A1.oid;




pgsql-novice by date:

Previous
From: Raimon Fernandez
Date:
Subject: Re: aggregate function ?
Next
From: Raimon Fernandez
Date:
Subject: Re: aggregate function ?