From: Richard Huxton <dev@archonet.com>
To: cristi <cristi@dmhi.ct.ro>
Cc: pgsql-sql@postgresql.org
Subject: Re: sql
Date: Wed, 23 Jun 2004 12:38:24 +0100
Message-ID: <40D96BB0.7020301@archonet.com> (raw)
In-Reply-To: <008601c4590e$f8a391e0$7202a8c0@cristiv>
References: <008601c4590e$f8a391e0$7202a8c0@cristiv>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dev@archonet.com, cristi@dmhi.ct.ro
Subject: Re: sql
In-Reply-To: <40D96BB0.7020301@archonet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox