Re: sort output per alpha-numeric?

From: Rui DeSousa <rui(at)crazybean(dot)net>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Sbob <sbob(at)quadratum-braccas(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: sort output per alpha-numeric?
Date: 2021-12-02 06:03:02
Message-ID: E3F7F091-808A-4C9E-950D-99B12AFE11D3@crazybean.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> On Dec 1, 2021, at 6:24 PM, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
> the normalized version of this model would store the width and height measurements separately and your print_size text would be a presentation issue.

I second this approach as it should be normalized into two fields. It would then be a simple order by area.

i.e. order by width * height

This would work in the meantime, given the data format doesn’t change:

order by split_part(print_size, 'x', 1)::int * split_part(print_size, 'x', 2)::int

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jiankang Ji 2021-12-02 09:16:31 Re: Are you working on both pentaho and postgresql?
Previous Message Alexey M Boltenkov 2021-12-02 05:40:09 Re: sort output per alpha-numeric?