X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 02A8B9F9C9E for ; Mon, 15 May 2006 21:08:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 00662-06 for ; Mon, 15 May 2006 21:08:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B47119F9C18 for ; Mon, 15 May 2006 21:08:14 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k4G0852T000442; Mon, 15 May 2006 20:08:05 -0400 (EDT) To: emilu@encs.concordia.ca cc: Amos Hayes , pgsql-sql@postgresql.org Subject: Re: Find min and max values across two columns? In-reply-to: <4468F558.7070407@encs.concordia.ca> References: <9558.1143234035@sss.pgh.pa.us> <4468F558.7070407@encs.concordia.ca> Comments: In-reply-to Emi Lu message dated "Mon, 15 May 2006 17:40:40 -0400" Date: Mon, 15 May 2006 20:08:05 -0400 Message-ID: <441.1147738085@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/111 X-Sequence-Number: 25142 Emi Lu writes: > ERROR: function greatest(integer, integer) does not exist > HINT: No function matches the given name and argument types. You may > need to add explicit type casts. We added greatest/least in 8.1, but before that you can just use a CASE expression instead, along the lines of case when x>y then x else y end regards, tom lane