![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
The database should store the data like dates of the beginning and the end of the school year, holidays, non school days, various events, etc. I want to get a Table or a View which I can use as a School Calendar with school days, and non school days too, and much more. I have created Tables with dates of the beginning date and the end date of the school year. I have Table with dates of holidays and/or non school days in the school year too. Can I create a Table or a View from these Tables to get such a school calendar? |
#3
| |||
| |||
|
|
Csanyi Pal <csanyipal (AT) gmail (DOT) com> wrote: The database should store the data like dates of the beginning and the end of the school year, holidays, non school days, various events, etc. I want to get a Table or a View which I can use as a School Calendar with school days, and non school days too, and much more. I have created Tables with dates of the beginning date and the end date of the school year. I have Table with dates of holidays and/or non school days in the school year too. Can I create a Table or a View from these Tables to get such a school calendar? Yes, it sounds like the set of tables you describe could support a great many useful queries, and you could encapsulate these in views to make them easier to use. Are you having some problem doing so? What have you tried? What did you expect to happen? What happened instead? |
#4
| |||
| |||
|
|
OK, I have an initial question. The start date and the end date of the first half part of school year are in two different tables in my database. How can I get rows in a view between those two dates? |
#5
| |||
| |||
|
|
Csanyi Pal <csanyipal (AT) gmail (DOT) com> wrote: OK, I have an initial question. The start date and the end date of the first half part of school year are in two different tables in my database. How can I get rows in a view between those two dates? Okay, you have the start- and end-date in 2 different tables? No problem: test=*# select * from t_start ; d ------------ 2012-01-01 (1 row) Time: 0,196 ms test=*# select * from t_end; d ------------ 2012-01-10 (1 row) Time: 0,240 ms test=*# select (d + s * '1day'::interval)::date from t_start, generate_series(0, ((select d from t_end) - (select d from t_start)))s; |
#6
| |||
| |||
|
|
Csanyi Pal <csanyipal (AT) gmail (DOT) com> wrote: The database should store the data like dates of the beginning and the end of the school year, holidays, non school days, various events, etc. I want to get a Table or a View which I can use as a School Calendar with school days, and non school days too, and much more. I have created Tables with dates of the beginning date and the end date of the school year. I have Table with dates of holidays and/or non school days in the school year too. Can I create a Table or a View from these Tables to get such a school calendar? Yes, it sounds like the set of tables you describe could support a great many useful queries, and you could encapsulate these in views to make them easier to use. |
|
Are you having some problem doing so? What have you tried? What did you expect to happen? What happened instead? |
#7
| |||
| |||
|
|
The first table contains the ordinal number of the semester (1 or 2) and the start dates of the same: iskolanaptar_201213=# select * from felevek_kezdetei_1_8; felev1v2 | datum ----------+------------ 1 | 2012-09-03 2 | 2013-01-15 (2 rows) The second table contains the end date of the first semester and the number of the days in this semester: iskolanaptar_201213=# select * from felev1_vege_tan_nap_1_8; datum | ennyi_tan_nap ------------+--------------- 2012-12-21 | 78 (1 row) |
![]() |
| Thread Tools | |
| Display Modes | |
| |