X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C4919476515 for ; Tue, 4 Mar 2003 17:09:50 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 38194-01 for ; Tue, 4 Mar 2003 17:09:47 -0500 (EST) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id 6CBD8476551 for ; Tue, 4 Mar 2003 15:22:51 -0500 (EST) Received: from [216.135.165.74] (HELO lazarus) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP-TLS id 2879785; Tue, 04 Mar 2003 12:22:36 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Ian Burrell , pgsql-sql@postgresql.org Subject: Re: Sorting by NULL values Date: Tue, 4 Mar 2003 11:01:52 -0800 User-Agent: KMail/1.4.3 References: <3E65023E.10404@onsitetech.com> In-Reply-To: <3E65023E.10404@onsitetech.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200303041101.52565.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new X-Archive-Number: 200303/137 X-Sequence-Number: 12177 Ian, > I am doing a query where I need to sort by a column that may be NULL > because it is coming from an OUTER JOIN. I noticed a difference between > PostgreSQL and other databases about where NULLs show up. It seems that > with Postgres, NULLs are sorted after other values. Other databases > sort them before. Not all other databases. It really depends. > Is there a way to replace the NULLs with > empty strings? Sure: UPDATE table SET column =3D '' WHERE column IS NULL --=20 Josh Berkus josh@agliodbs.com Aglio Database Solutions San Francisco