Re: Calculation of per Capita on-the-fly - problems with SQL syntax

Поиск
Список
Период
Сортировка
От Stefan Schwarzer
Тема Re: Calculation of per Capita on-the-fly - problems with SQL syntax
Дата
Msg-id 0EFAED2F-5AA4-4016-856F-4B56E6DDE138@grid.unep.ch
обсуждение исходный текст
Ответ на Re: Calculation of per Capita on-the-fly - problems with SQL syntax  (Michael Glaesemann <grzm@seespotcode.net>)
Ответы Re: Calculation of per Capita on-the-fly - problems with SQL syntax  (Michael Glaesemann <grzm@seespotcode.net>)
Список pgsql-general
> I suggest using two *date* (or possibly integer) columns for each
> row and consider each row an year interval (in the mathematical
> sense, not to be confused with SQL intervals, which are actually
> durations). Depending on the interval representation you choose
> (closed-open or closed-closed), a single-year interval (say, 1970),
> would be represented as either ('1970-01-01', '1970-01-01') or
> ('1970-01-01', '1971-01-01').

While trying to move step by step into the "right" direction, I
discover at every second step some "riddles" I have to solve...
Although not so much in favor of using two columns for the year
(start, end), I did it - only to discover that I have a couple of
variables that don't have a "numerical" year (such as 1970, or even
1970-75), but a textual called "various". "Various" means that there
is no common year for all countries for the retrieval/assessment of
the given value. That is, for one country it can be 1990, for another
1992, for a third 1995. As the actual year is not important (and not
always defined), one tries to use this kind of common describer:
various.

Evidently, it doesn't work with any of the envisaged or proposed
table layouts.

Does anyone have a nice solution to this problem? Thanks for any ideas!

Yours (slightly frustrated),

Stef

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

Предыдущее
От: Farhan Mughal
Дата:
Сообщение: Architecture diagram!
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: Calculation of per Capita on-the-fly - problems with SQL syntax