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