Re: sort output per alpha-numeric?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: sort output per alpha-numeric?
Дата
Msg-id CAKFQuwZNkdXjmgiw-BWq=sSoDJEZdt6-QhERc30ZpWdkKRqUqg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: sort output per alpha-numeric?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: sort output per alpha-numeric?  (Rui DeSousa <rui@crazybean.net>)
Список pgsql-admin
On Wed, Dec 1, 2021 at 3:50 PM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Wed, Dec 1, 2021 at 3:38 PM Sbob <sbob@quadratum-braccas.com> wrote:

I get a list like this:

print_size  
------------
11x14

If this isn't sufficient (e.g., if the second dimension causes the issue) you may need to break the two-part string into two separate fields, convert them to integers, and then sort on the pair.


Just for some perspective - the normalized version of this model would store the width and height measurements separately and your print_size text would be a presentation issue.  Though the use of a lookup table may ease the usage of this somewhat.

Another possibility, one that I tend to avoid, would be to use an "enum" type here - which has the property that the elements of the enum have an order that is independent of the display value.

In short though, print_size as you've defined it is a composite value which should be broken down into its components during the process of normalization.

David J.

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: sort output per alpha-numeric?
Следующее
От: Gavan Schneider
Дата:
Сообщение: Re: sort output per alpha-numeric?