Select groupping by one column

From: Josué Maldonado <josue(at)lamundial(dot)hn>
To: pgsql-general(at)postgresql(dot)org
Subject: Select groupping by one column
Date: 2003-12-18 23:09:52
Message-ID: 3FE233C0.6050502@lamundial.hn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello list,

I have a table called pedh that looks like this:

REFNO FECHA OCNUM PVD
0199 10/12/2003 5224 632
0199 10/12/2003 5224 632
1264 10/18/2003 8991 210
1264 10/18/2003 8991 210
1264 10/18/2003 8991 210
9093 10/20/2003 6895 520
9093 10/20/2003 6895 520

I need to select one record groupped by column refno, I tried using this
code:

select refno, max(fecha), max(ocnum), max(pvd) from pedh

It seems to work fine, but is there another way to get the same result
avoing use of aggregate functions?

Thanks in advance

--
Josué Maldonado

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Josué Maldonado 2003-12-18 23:34:44 Re: Select groupping by one column
Previous Message Joe Conway 2003-12-18 23:03:30 Re: functions returning sets