X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 43D423A2B9D for ; Fri, 29 Oct 2004 16:56:49 +0100 (BST) 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 77383-04 for ; Fri, 29 Oct 2004 15:56:44 +0000 (GMT) Received: from pimout6-ext.prodigy.net (pimout6-ext.prodigy.net [207.115.63.78]) by svr1.postgresql.org (Postfix) with ESMTP id C21443A2BB1 for ; Fri, 29 Oct 2004 16:56:43 +0100 (BST) Received: from [192.168.1.207] (214.adsl.snet.net [69.177.163.214] (may be forged)) by pimout6-ext.prodigy.net (8.12.10 milter /8.12.10) with ESMTP id i9TFuYSN194636; Fri, 29 Oct 2004 11:56:41 -0400 Message-ID: <418268D3.3080700@kencast.com> Date: Fri, 29 Oct 2004 11:59:15 -0400 From: Wei Weng User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruno Wolff III Cc: pgsql-sql@postgresql.org Subject: Re: How do you compare (NULL) and (non-NULL)? References: <417EB238.1000109@kencast.com> <20041027153643.GA14288@wolff.to> In-Reply-To: <20041027153643.GA14288@wolff.to> 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.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/208 X-Sequence-Number: 19311 Bruno Wolff III wrote: > On Tue, Oct 26, 2004 at 16:23:20 -0400, > Wei Weng wrote: > >>In the following query >> >>SELECT Parent FROM Channels ORDER BY Parent ASC; >> >>If I have a couple of (NULL)s in the field [Parent], they will be listed at >>the bottom of the query result. >> >>Is it because PostgreSQL considers (NULL) as the biggest value? If I run >>the same query under MSSQL Server 2000, I get the exact opposite result >>regarding the order of (NULL)s and (non-NULL) values. They are listed at >>the very beginning of the query result. > > > If the order matters, you can order by IS NULL or IS NOT NULL. > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match > > How do I write that? Thanks Wei