Amos Hayes <ahayes(at)polkaroo(dot)net> writes:
> I'm trying to build a query that among other things, returns the
> minimum and maximum values contained in either of two columns.
I think you might be looking for
select greatest(max(columnA), max(columnB)) from tab;
select least(min(columnA), min(columnB)) from tab;
greatest/least are relatively new but you can roll your own in
older PG releases.
regards, tom lane