Re: Calculation of per Capita on-the-fly - problems with SQL syntax
В списке pgsql-general по дате отправления:
| От | Sam Mason |
|---|---|
| Тема | Re: Calculation of per Capita on-the-fly - problems with SQL syntax |
| Дата | |
| Msg-id | 20071015161935.GB10098@samason.me.uk обсуждение |
| Ответ на | Re: Calculation of per Capita on-the-fly - problems with SQL syntax (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>) |
| Список | pgsql-general |
On Mon, Oct 15, 2007 at 02:08:24PM +0200, Stefan Schwarzer wrote: > Just one thing: As my year columns can have as well values like "1970-75", > they are not integers, but text fields. Thus, the "IN" parameter in the > "WHERE" clause doesn't work. Do you have any other idea how ti could work? I'd be tempted to split your "year" column (maybe more appropriately named as "year range") into two integer columns, one for the start year and one for the end year. Once you've done that it would become much easier to write queries. Generally, you want to split the information that the database uses into one piece per column. If you do split it then you could do something like: WHERE d.year_min <= 2004 AND d.year_max >= 2002 Sam
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера