Re: DISTINCT ordering

From: Ron St-Pierre <rstpierre(at)syscor(dot)com>
To: Jake Stride <nsuk(at)users(dot)sourceforge(dot)net>, pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: DISTINCT ordering
Date: 2004-08-10 18:37:11
Message-ID: 411915D7.7040801@syscor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Jake Stride wrote:

>Because I don¹t want the name in lower case, what I want is
>
>The
>the
>Z
>
>not:
>
>The
>Z
>the
>
>
>

>This is what I have at present, although slightly adjusted, but I wanted to
>know if it was possible without 2 selects,
>
>SELECT SS.name FROM (SELECT DISTINCT name FROM someview) SS ORDER BY
> lower(name);
>
>Jake
>
>

In that case I don't think that you can do it without a subquery. I
think that if the db was configured with a different locale (en_GB or
en_US) it would sort the data as you want it, but I think that other
problems might occur. I haven't dealt with the locale settings much
myself, but there are frequently questions(problems?) such as yours
which show up on the GENERAL discussion list. You can search the GENERAL
archives and documentation if you want more background on this it it's a
big problem. Or perhaps someone with more 'locale' knowledge might
confirm this.

hth
Ron

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Oliver Fromme 2004-08-10 19:04:37 Re: lock entire database
Previous Message Taber, Mark 2004-08-10 18:33:30 What constitutes a pgsql session?