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 162C39F9F8F for ; Tue, 16 May 2006 11:44:31 -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 78610-10 for ; Tue, 16 May 2006 11:44:12 -0300 (ADT) X-Greylist: delayed 17:03:19.280426 by SQLgrey- Received: from perseverance.encs.concordia.ca (perseverance-96.encs.concordia.ca [132.205.96.94]) by postgresql.org (Postfix) with ESMTP id 63E5B9F9C18 for ; Tue, 16 May 2006 11:44:09 -0300 (ADT) Received: from [132.205.47.225] (emilu@cacao.encs.concordia.ca [132.205.47.225]) by perseverance.encs.concordia.ca (8.13.6/8.13.6) with ESMTP id k4GEi7Na009379; Tue, 16 May 2006 10:44:07 -0400 Message-ID: <4469E537.6010108@encs.concordia.ca> Date: Tue, 16 May 2006 10:44:07 -0400 From: Emi Lu Reply-To: emilu@encs.concordia.ca User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane CC: pgsql-sql@postgresql.org Subject: Re: Find min and max values across two columns? References: <9558.1143234035@sss.pgh.pa.us> <4468F558.7070407@encs.concordia.ca> <441.1147738085@sss.pgh.pa.us> In-Reply-To: <441.1147738085@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.43 on perseverance.encs.concordia.ca at 2006/05/16 10:44:07 EDT X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/112 X-Sequence-Number: 25143 Thank you Tom. >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 > >---------------------------(end of broadcast)--------------------------- >TIP 6: explain analyze is your friend > >