X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 297D7D85D4 for ; Wed, 19 Oct 2005 03:03:08 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 42306-03 for ; Wed, 19 Oct 2005 06:03:05 +0000 (GMT) Received: from mail.travelamericas.com (unknown [206.130.134.147]) by svr1.postgresql.org (Postfix) with SMTP id 65801D849C for ; Wed, 19 Oct 2005 03:03:05 -0300 (ADT) Received: (qmail 11634 invoked from network); 19 Oct 2005 06:03:06 -0000 Received: from unknown (HELO ?10.0.0.253?) (10.0.0.253) by verkiel.travelamericas.com with SMTP; 19 Oct 2005 06:03:06 -0000 Message-ID: <4355E199.2040904@travelamericas.com> Date: Tue, 18 Oct 2005 23:03:05 -0700 From: Chris Travers User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Glaesemann Cc: Vikas J , postgresql sql list Subject: Re: Problem -Postgre sql References: <000c01c5ce34$61797c20$6f0aa8c0@codecindia.com> <00b101c5d46e$3cd6fa60$6f0aa8c0@codecindia.com> <8FB39706-1EFC-4D9F-ADBD-1311D4B08940@myrealbox.com> In-Reply-To: <8FB39706-1EFC-4D9F-ADBD-1311D4B08940@myrealbox.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.046 required=5 tests=[AWL=-0.004, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/212 X-Sequence-Number: 23065 Correct me if I am wrong, but isn't COALESCE standard in this way? Best Wishes, Chris Travers Metatron Technology Consulting Michael Glaesemann wrote: > [Please do not email me directly. Please post to the list so others > may help and benefit from the discussion.] > > On Oct 19, 2005, at 14:30 , Vikas J wrote: > >> IsNull in sql server has syntax like isnull(column,substitute) >> if "column" is null it shows value of "substitute". That can be >> achieved >> with CASE clause in postrgre but I want alternate function. > > > If you look at the doc links I provided below, you will find that > COALESCE does exactly this. > >> Can you tell me how to write function like MAX() that will work >> directly on >> colmuns. I want to create my own function that will not need table >> name as >> paramter. >> it shld work similarly to max() function in postgre. > > > [Again, it's PostgreSQL or Postgres. It is *not* spelled "postgre".] > > In my experience, the max() aggregate function does not require table > names as parameters and work on columns directly. > http://www.postgresql.org/docs/8.0/interactive/functions-aggregate.html > > I suggest you take some time to look at the docs. They're quite > extensive and helpful. > http://www.postgresql.org/docs/8.0/interactive/index.html > > > Michael Glaesemann > grzm myrealbox com > > >>> I'm not quite sure what the ISNULL() function does in SQL Server, but >>> it sounds like it might be similar to either COALESCE or the IS NULL >>> expression. >>> >>> These pages might help you: >>> >>> COALESCE >>> http://www.postgresql.org/docs/8.0/interactive/functions- >>> conditional.html#AEN12056 >>> >>> IS NULL >>> http://www.postgresql.org/docs/8.0/interactive/functions- >>> comparison.html >> > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Have you searched our list archives? > > http://archives.postgresql.org > >