Re: Design of a database table

2018-07-31 Thread Adrian Klaver
On 07/30/2018 11:40 PM, hmidi slim wrote: Actually, the data_periods contains a complete range such as [2018-09-01,2018-09-30] and data_sub_periods contains sub periods contained in this period like: [2018-09-05, 2018-09-07] [2018-09-09, 2018-09-11] [2018-09-12, 2018-09-19] I make two conditio

Re: Design of a database table

2018-07-30 Thread hmidi slim
Actually, the data_periods contains a complete range such as [2018-09-01,2018-09-30] and data_sub_periods contains sub periods contained in this period like: [2018-09-05, 2018-09-07] [2018-09-09, 2018-09-11] [2018-09-12, 2018-09-19] I make two conditions in order to fetch first if the period [2018

Re: Design of a database table

2018-07-30 Thread Adrian Klaver
On 07/30/2018 07:37 AM, hmidi slim wrote: I'm trying to design a database table. First of all there are two alternatives: 1-) Divide the table into two tables and make a join. 2-) Design a single table. 1rst alternative: Create table data_periods( id serial primary key not null, period daterang

Re: Design of a database table

2018-07-30 Thread Ron
On 07/30/2018 09:37 AM, hmidi slim wrote: I'm trying to design a database table. First of all there are two alternatives: 1-) Divide the table into two tables and make a join. 2-) Design a single table. 1rst alternative: Create table data_periods( id serial primary key not null, period daterang

Design of a database table

2018-07-30 Thread hmidi slim
I'm trying to design a database table. First of all there are two alternatives: 1-) Divide the table into two tables and make a join. 2-) Design a single table. 1rst alternative: Create table data_periods( id serial primary key not null, period daterange, project_id integer ) create table data_pe