I need to fill up a sparse table in an view

Поиск
Список
Период
Сортировка
От Andreas
Тема I need to fill up a sparse table in an view
Дата
Msg-id 5132536A.50508@gmx.net
обсуждение исходный текст
Ответы Re: I need to fill up a sparse table in an view  (Victor Yegorov <vyegorov@gmail.com>)
Список pgsql-sql
Hi,

I need to fill up a sparse table in an view.
The table holds some numbers relating months and objects.
The month is an integer in the format YYYYMM.

To make it more convenient to manage this table I decidet to let a value 
be good till the next entry.
E.g. if there is an entry in january and march, the january entry is 
good in february, too.


So the table looks like.
my_numbers ( object_id int, month int, some_nr int )

( 17, 201301, 123 ),
( 42, 201301, 456 ),
( 42, 201303, 789 ),

Now I need a view that fills the gaps up till the current month.


( 17, 201301, 123 ),
( 17, 201302, 123 ),      <-- filled gap
( 17, 201303, 123 ),      <-- filled gap
( 42, 201301, 456 ),
( 42, 201302, 456 ),      <-- filled gap
( 42, 201303, 789 ),


Is this possible?



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

Предыдущее
От: Wayne Cuddy
Дата:
Сообщение: Re: Need help revoking access WHERE state = 'deleted'
Следующее
От: Victor Yegorov
Дата:
Сообщение: Re: I need to fill up a sparse table in an view