Just use the CASE statment, example: create table test (foo int, bar int); insert into test2 values (1, 2); insert into test2 values (4, 3); select case when foo > bar then foo else bar end from test2; Bas.
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных