Re: sql - Mailing list pgsql-sql

From Richard Huxton
Subject Re: sql
Date
Msg-id 40D96BB0.7020301@archonet.com
Whole thread Raw
In response to sql  ("cristi" <cristi@dmhi.ct.ro>)
List pgsql-sql
cristi wrote:
> 
> I mean:
> I want to select the records wich for co1,n1,l1,m1 value are the same and
> has the maxim value of the ore field
> adding to that value the value of the records which are not selected.

SELECT co,clo1,nl,l1,m1,SUM(ore) AS tot_ore
FROM xxx
WHERE <conditions here>
GROUP BY co,clo1,nl,l1,m1
ORDER BY co,clo1,nl,l1,m1;

--   Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: sad
Date:
Subject: feature request ?
Next
From: Clive Page
Date:
Subject: Non-standard function names