Re: Sort question - Fractions, Metric etc

Поиск
Список
Период
Сортировка
От Pól Ua Laoínecháin
Тема Re: Sort question - Fractions, Metric etc
Дата
Msg-id CAF4RT5SFq2q9H4YUMHs6fzJZ=TFpOEj0h9wYyoCPUusZt7tkng@mail.gmail.com
обсуждение исходный текст
Ответ на Sort question - Fractions, Metric etc  (Bret Stern <bret_stern@machinemanagement.com>)
Список pgsql-general
> I have a table with metric, imperial, fraction columns.

Have  "metric_equivalent_magnitude" and "metric_equivalent_unit"
columns and do all your sorting &c. via those columns. Use the
relatively new generated (or computed/calculated) columns to calculate
these. That way, you get the conversion correct once and you don't
have to worry about it any more!

That way, you can compare between cubits, furlongs and kilometres or
barrels, hogsheads and litres & American and British imperial units.

You might also want a metric_equivalent_type to ensure that you're not
comparing lengths with volumes, masses or velocities... &c...?

Pól...



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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Sort question - Fractions, Metric etc
Следующее
От: Pól Ua Laoínecháin
Дата:
Сообщение: Using a TRIGGER with window functions.