Skip site navigation (1) Skip section navigation (2)

Re: To get a Table or View like a Calendar with dates

From: Csanyi Pal <csanyipal(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: To get a Table or View like a Calendar with dates
Date: 2012-08-11 13:21:04
Message-ID: 871ujd36pr.fsf@gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi Kevin,

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:

> 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?

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?

I expect to get rows like:
date1 weekday1
date2 weekday2
 ..
datex weekdayx

where 'date1' should to be the first day in the school year and 'datex'
should to be the last day in the first part of school year.

If I can get these rows in a view then I can after that modify the view
so I get extended informations like holidays if such occures in that
range of dates, etc.

-- 
Regards from Pal



In response to

Responses

pgsql-novice by date

Next:From: Andreas KretschmerDate: 2012-08-11 17:04:55
Subject: Re: To get a Table or View like a Calendar with dates
Previous:From: Anne WainwrightDate: 2012-08-10 11:55:46
Subject: Re: adding a field

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group