Re: Sort order confusion - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Sort order confusion
Date
Msg-id 20040206010105.GA3990@dcc.uchile.cl
Whole thread Raw
In response to Re: Sort order confusion  (Stephen Robert Norris <srn@commsecure.com.au>)
Responses Re: Sort order confusion  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-general
On Fri, Feb 06, 2004 at 11:21:41AM +1100, Stephen Robert Norris wrote:
> On Fri, 2004-02-06 at 11:12, Steve Crawford wrote:
> > I am suffering some sort order confusion. Given a database, "foo",
> > with a single character(4) column of data left padded with spaces I
> > get:
> >
> > select * from foo order by somechars;

Cast it:

alvherre=> select * from foo order by bar::text::int;
 bar
------
    0
    1
   10
   33
  100
  101
  333
  503
(8 filas)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"La naturaleza, tan frágil, tan expuesta a la muerte... y tan viva"

pgsql-general by date:

Previous
From: Steve Crawford
Date:
Subject: Re: Sort order confusion
Next
From: Steve Crawford
Date:
Subject: Re: Sort order confusion