From: | Ben Kim <bkim(at)tamu(dot)edu> |
---|---|
To: | giuseppe(dot)derossi(at)email(dot)it |
Cc: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: HELP, can't implement e filter |
Date: | 2007-08-20 14:07:46 |
Message-ID: | Pine.GSO.4.64.0708200905210.23093@coe.tamu.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
On Sun, 19 Aug 2007, giuseppe(dot)derossi(at)email(dot)it wrote:
> Hi,
> I need to implement a filter in order to select from the first table the
> second one...
> c1 c2 c3 c4 c5
> 1)133659;1;"0039";"00121";7
> 2)133664;1;"0039";"00121";12
> 3)133664;2;"0039";"00121";12
> 4)133665;2;"0039";"00121";12
> 5)135460;1;"0039";"01152";
> 6)135460;2;"0039";"01152";
> 7)135471;1;"0050";"00153";4
> 8)135471;2;"0050";"00153";4
>
> 1)133659;1;"0039";"00121";7
> 3)133664;2;"0039";"00121";12
> 4)133665;2;"0039";"00121";12
> 6)135460;2;"0039";"01152";
> 8)135471;2;"0050";"00153";4
There should be something better but this might work.
select * from testtable where (c1,c2) in (select c1, max(c2) from
testtable group by c1 );
HTH
Ben K.
Developer
http://benix.tamu.edu
From | Date | Subject | |
---|---|---|---|
Next Message | Scott Marlowe | 2007-08-20 14:14:45 | Re: HELP, can't implement e filter |
Previous Message | Pallav Kalva | 2007-08-20 13:44:24 | Re: Invalid String enlargement |