Re: Database/Table Design for Global Country Statistics

Поиск
Список
Период
Сортировка
От Stefan Schwarzer
Тема Re: Database/Table Design for Global Country Statistics
Дата
Msg-id F1570191-DF9C-46B4-AB5F-044BB1DA201D@grid.unep.ch
обсуждение исходный текст
Ответ на Re: Database/Table Design for Global Country Statistics  (Richard Huxton <dev@archonet.com>)
Ответы Re: Database/Table Design for Global Country Statistics  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
> Umm - not sure what you're after. What's wrong with one of:
>   SELECT ... ORDER BY year, value
>   SELECT ... ORDER BY value, year
>
> Or did you want a particular year pulled out of the general list,
> in which case try something like:
>   SELECT ... ORDER BY (year = 1970), year, value
>   SELECT ... ORDER BY (year <> 1970), year, value
> This works because booleans are considered sortable too.

Uiuiui.... and it gets even worse... I want to implement the
possibility to calculate on-the-fly the per Capita values for the
selected data set. With the "old" table design it would be something
like this:

       SELECT (fish_catch.y_1970 / pop_total.y_1970),
(fish_catch.y_1971 / pop_total.y_1971) FROM .....

But how would this work with the new design?

Sorry for these repeated questions.... (But it's you guys' fault -
you said I had a bad table design.... :-))

Thanks for any hints!

Stef

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Database/Table Design for Global Country Statistics
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Database/Table Design for Global Country Statistics