Re: order by - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: order by
Date
Msg-id 20030326104353.P63544-100000@megazone23.bigpanda.com
Whole thread Raw
In response to order by  (Jodi Kanter <jkanter@virginia.edu>)
List pgsql-sql
On Wed, 26 Mar 2003, Jodi Kanter wrote:

> Is there a known problem with the SQL order by clause within postgres
> version 7.2.3? I am trying to sort a field which holds file names that
> have some spaces as well non-alphanumeric characters, including
> underscores (see below).
>
> The results of:
> select study_name from study order by study_name;
>
>
>   Study1a
>   Study 1b
>   Study  1c
>   Study1d
>
>
> The results of sorting in Perl (which uses Linux's underlying sort function)
>
> Study  1c
> Study 1b
> Study1a
> Study1d
>
> Is there any way around this difference? Blank spaces should show up
> first in the sort.

Are you in "C" locale or something like "en_US"?  In the latter, the first
is the "correct" ordering.



pgsql-sql by date:

Previous
From: "Tomasz Myrta"
Date:
Subject: Re: order by
Next
From: gar8@pitt.edu (Tony Reina)
Date:
Subject: How can I pass an array from PostgreSQL to C (libpq)?