pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karel Zak <zakkr@zf.jcu.cz>
To: Jeff Boes <jboes@nexcerpt.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: to_char() and order-by
Date: Fri, 28 Jun 2002 09:59:37 +0200
Message-ID: <20020628095937.A13987@zf.jcu.cz> (raw)
In-Reply-To: <d40a65a1.0206271127.45c44b7d@posting.google.com>
References: <d40a65a1.0206271127.45c44b7d@posting.google.com>

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  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz





view thread (3+ messages)  latest in thread

Message-ID: <20020628095937.A13987@zf.jcu.cz>
Permalink:  ../20020628095937.A13987@zf.jcu.cz/
Also on:    postgresql.org/message-id/20020628095937.A13987@zf.jcu.cz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: zakkr@zf.jcu.cz, jboes@nexcerpt.com
  Subject: Re: to_char() and order-by
  In-Reply-To: <20020628095937.A13987@zf.jcu.cz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox