On Jan 7, 2008 4:03 PM, Emi Lu <[EMAIL PROTECTED]> wrote: > Greetings, > > Version: PostgreSQL 8.0.13 on i686-pc-linux-gnu > > I have a table test(col1, col2, col3) > > For each row, I'd like to get the "max"(col1, col2, col3). > > For example, test(1, 5, 2) > test(8, 1, 3) > test(12, 1, 1) > > > select ?max?(col1, col2, col3) as result; > will return > > result > ------- > 5 > 8 > 12
select max(col1) from table union all select max(col2) from table union all select max(col3) from table ---------------------------(end of broadcast)--------------------------- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate