Re: Select groupping by one column

From: Josué Maldonado <josue(at)lamundial(dot)hn>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Select groupping by one column
Date: 2003-12-18 23:34:44
Message-ID: 3FE23994.4090903@lamundial.hn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello Bruno,

Bruno Wolff III wrote:
>>
>>select refno, max(fecha), max(ocnum), max(pvd) from pedh
>
>
> I don't see how that could work. Maybe you left off group by. But if you
> did the aggreates could come from different rows, which might not be what
> you want.

I missed the group by 1, I'm sorry.

>
>
>>It seems to work fine, but is there another way to get the same result
>>avoing use of aggregate functions?
>
>
> You might be able to use distinct on instead of aggregates.

Thanks

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lynn.Tilby 2003-12-18 23:34:47 DB & Log Files removed...
Previous Message Tom Lane 2003-12-18 23:09:52 Re: functions returning sets