"Ben-Nes Michael" <miki@canaan.co.il> writes:
> Just wonder, how can i do:
> select max(column1), column2 from table;
> its saying:
> ERROR: Attribute table.column2 must be GROUPed or used in an aggregate
> function
> and all i want is that column2 value will be the mate fo column1 max?
You want DISTINCT ON ... see the weather-reports example on the SELECT
man page.
regards, tom lane