Re: Sort question - Fractions, Metric etc - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Sort question - Fractions, Metric etc
Date
Msg-id 24d005b3-47a4-3f78-450e-d394b9e47d6f@aklaver.com
Whole thread Raw
In response to Sort question - Fractions, Metric etc  (Bret Stern <bret_stern@machinemanagement.com>)
Responses Re: Sort question - Fractions, Metric etc
List pgsql-general
On 8/14/21 9:14 AM, Bret Stern wrote:
> I have a table with metric, imperial, fraction columns.
> 
> Is there a way to sort correctly using imperial (eg; .125, .375, .437 -> 
> 1., 1.125)

Alright how is this different from metric or fraction?

I can sort of see fraction if you mean as 1/3, 1/20, etc.

What is the data type of the field you are storing this in?

> 
> Couldn't handle it with ORDER BY ASC, DESC args so I added a sort_column 
> and sorted based
> 
> on those values eg; 1,2,3,4,5,6 indicating the value I need to show in 
> which sequence.
> 
> 
> Just curious what the pro's do
> 
> Bret
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Bret Stern
Date:
Subject: Sort question - Fractions, Metric etc
Next
From: Shrikant Bhende
Date:
Subject: Join for the parent table will not leverage the index scan