collating advice

Поиск
Список
Период
Сортировка
От Laurette Cisneros
Тема collating advice
Дата
Msg-id Pine.LNX.4.44.0207111414390.16757-100000@visor.corp.nextbus.com
обсуждение исходный текст
Ответы Re: collating advice  (Chris Albertson <chrisalbertson90278@yahoo.com>)
Список pgsql-general
How to sort a text column in numerical order?

I have a text column in a table:

...
col2   text
...

which can contains values that are both number and a combination of numeric
and text:

1
1a
2
2a
2b
10
12
12a
etc.

Of course, they aren't entered into the table in any particular order.

A select like this:

select * from tablex order by col2;

returns this:

10
12
12a
1
1a
2a
2b

what we would like to get is:
1
1a
2
2a
2b
10
12
12a

Any ideas on how to achieve this?

Thanks,

--
Laurette Cisneros
The Database Group
(510) 420-3137
NextBus Information Systems, Inc.
www.nextbus.com
----------------------------------
"Intelligence complicates. Wisdom simplifies."
  -- Mason Cooley


В списке pgsql-general по дате отправления:

Предыдущее
От: Andreas Plesner Jacobsen
Дата:
Сообщение: Re: SELECT...FOR UPDATE
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: SELECT...FOR UPDATE