Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 28A41475AD8 for ; Fri, 28 Jun 2002 03:59:47 -0400 (EDT) Mailbox-Line: From zakkr@zf.jcu.cz Fri Jun 28 03:59:47 2002 Received: from ara.zf.jcu.cz (ara.zf.jcu.cz [160.217.161.4]) by postgresql.org (Postfix) with ESMTP id 9A760475924 for ; Fri, 28 Jun 2002 03:59:41 -0400 (EDT) Received: from ara.zf.jcu.cz (LOCALHOST [127.0.0.1]) by ara.zf.jcu.cz (8.12.1/8.12.1/Debian -5) with ESMTP id g5S7xcAr018238; Fri, 28 Jun 2002 09:59:38 +0200 Received: (from zakkr@localhost) by ara.zf.jcu.cz (8.12.1/8.12.1/Debian -5) id g5S7xbh6018237; Fri, 28 Jun 2002 09:59:37 +0200 Date: Fri, 28 Jun 2002 09:59:37 +0200 From: Karel Zak To: Jeff Boes Cc: pgsql-sql@postgresql.org Subject: Re: to_char() and order-by Message-ID: <20020628095937.A13987@zf.jcu.cz> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from jboes@nexcerpt.com on Thu, Jun 27, 2002 at 12:27:11PM -0700 X-Spam-Status: No, hits=-8.3 required=5.0 tests=IN_REP_TO,ORDER_STATUS,X_NOT_PRESENT version=2.30 X-Spam-Level: X-Archive-Number: 200206/384 X-Sequence-Number: 8349 On Thu, Jun 27, 2002 at 12:27:11PM -0700, Jeff Boes wrote: > Perhaps this was covered in the 7.2.x release notes, but it's mystifying us: Please, how are data without to_char()? select time_link from stat_fetch where time_link is not null order by 1 desc limit 10; Karel > select to_char(time_link,'999.99') from stat_fetch > where time_link is not null > order by 1 desc limit 10; > > (time_link is a double-precision column.) Under 7.1.3, this returns results like: > > to_char > --------- > 9.99 > 9.99 > 9.99 > 9.99 > 9.99 > 9.99 > 9.99 > 9.99 > 9.99 > 9.99 > (10 rows) > > while under 7.2.1, you get the top 10 rows in *numerical* order: > > to_char > --------- > 278.78 > 261.07 > 240.25 > 180.24 > 173.26 > 160.35 > 159.02 > 144.57 > 134.21 > 131.66 > (10 rows) -- Karel Zak http://home.zf.jcu.cz/~zakkr/ C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz