From: cristi <cristi@dmhi.ct.ro>
To: pgsql-sql@postgresql.org
Subject: sql
Date: Wed, 23 Jun 2004 13:43:50 +0300
Message-ID: <008601c4590e$f8a391e0$7202a8c0@cristiv> (raw)
I have the following table structure:
CREATE TABLE "xxx" (
"co" character varying(7),
"co1" character varying(9),
"n1" character varying(15),
"l1" character varying(5),
"m1" smallint,
"ore" bigint
);
who contains the following date:
22021CC 1044 637 S5G8 407 5
22021CC 1044 637 S5G8 409 47
22021CD 1044 637 S5G8 410 24
22022BB 1044 637 S5G8 409 10
I need a SQL select which result to be:
22021CC 1044 637 S5G8 407 5
22021CC 1044 637 S5G8 409 57
22021CD 1044 637 S5G8 410 24
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.
Wou!
Thanks in advance!
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: cristi@dmhi.ct.ro
Subject: Re: sql
In-Reply-To: <008601c4590e$f8a391e0$7202a8c0@cristiv>
* 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