"correct" sorting.

From: Jeff MacDonald <jeff(at)tht(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: "correct" sorting.
Date: 2001-05-03 04:40:34
Message-ID: Pine.NEB.4.05.10105030038150.18863-100000@tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi folks,

say i have a text field with teh values

1,2,3,10,20,30,1a,1b,2a,2b

and i want to sort it so i get,

1
1a
1b
2
2a
2b
3
10
20
30

is there anyway to do that with postgresql ?
below is what actually happens.

jeff=> select * from foo order by var1;
var1
------
1
10
1a
1b
2
20
2a
2b
3
30
3a
3b
(12 rows)

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2001-05-03 12:46:07 Re: How to encode and decode password in pgsql !!
Previous Message Ligia Pimentel 2001-05-03 00:55:39 Dateadd