Re: Ordering in SELECT statement - Mailing list pgsql-general

From PFC
Subject Re: Ordering in SELECT statement
Date
Msg-id op.tujs9dbgcigqcu@apollo13
Whole thread Raw
In response to Re: Ordering in SELECT statement  (Michael Glaesemann <grzm@seespotcode.net>)
List pgsql-general
> On Jun 26, 2007, at 14:41 , kdealba@uaaan.mx wrote:
>> and what I need is the following ("old fashion", that is, the "SPACE"
>> is another character whose ASCII value is before any other LATIN
>> letter's!!)
>> AB  CD
>> AB  EF
>> ABAB
>> ABD  E

    What you don't want :

peufeu=> SELECT column1 FROM (VALUES ('ABCD'), ('A BCD'), ('abcd'),
('ABcd'), ('AB'), ('AbC d')) AS foo  ORDER BY column1;
  column1
---------
  AB
  abcd
  AbC d
  ABcd
  ABCD
  A BCD
(6 lignes)

    What you want :

peufeu=> SELECT column1 FROM (VALUES ('ABCD'), ('A BCD'), ('abcd'),
('ABcd'), ('AB'), ('AbC d')) AS foo  ORDER BY string_to_array( column1, '
' );
  column1
---------
  A BCD
  AB
  AbC d
  abcd
  ABcd
  ABCD
(6 lignes)

pgsql-general by date:

Previous
From: "Willy-Bas Loos"
Date:
Subject: Re: escaped rolenames in pg_has_role
Next
From: PFC
Date:
Subject: Re: a JOIN on same table, but 'slided over'