Ask About SQL

From: Otniel Michael <otnieltera(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Ask About SQL
Date: 2009-08-19 10:17:07
Message-ID: 1703cd180908190317p3b1c4140hc9cbe41331c0725e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi All.

Can help to create sql queries for this data :

tabel A
field1, field2, field3
x1, y1, 5
x1, y2, 1
x2, y1, 2
x2, y3, 4
x1, y3, 4

I want to get 2 record with the max value at field3 for each kombination of
field1 :

tabel B
field1, field2, field3
x1, y1, 5
x1, y3, 4
x2, y3, 4
x2, y1, 2

Anyone have an ideas?
Thanks anyway.

--
-------------------------------------------------------------------
"He who is quick to become angry will commit folly, and a crafty man is
hated"

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ivan Voras 2009-08-19 10:19:17 Re: SQL Query Performance - what gives?
Previous Message Otniel Michael 2009-08-19 09:22:21 Ask To Optimize Looping