database-design

YYYY-MM column type in PostgreSQL

萝らか妹 提交于 2020-11-29 08:19:08
问题 I need to a value associated to a month and a user in a table. And I want to perform queries on it. I don't know if there is a column data type for this type of need. If not, should I: Create a string field and build year-month concatenation (2017-01) Create a int field and build year-month concatenation (201701) Create two columns (one year and one month) Create a date column at the beginning of the month (2017-01-01 00:00:00) Something else? The objective is to run queries like (pseudo-SQL)

YYYY-MM column type in PostgreSQL

牧云@^-^@ 提交于 2020-11-29 08:18:51
问题 I need to a value associated to a month and a user in a table. And I want to perform queries on it. I don't know if there is a column data type for this type of need. If not, should I: Create a string field and build year-month concatenation (2017-01) Create a int field and build year-month concatenation (201701) Create two columns (one year and one month) Create a date column at the beginning of the month (2017-01-01 00:00:00) Something else? The objective is to run queries like (pseudo-SQL)

YYYY-MM column type in PostgreSQL

喜你入骨 提交于 2020-11-29 08:18:34
问题 I need to a value associated to a month and a user in a table. And I want to perform queries on it. I don't know if there is a column data type for this type of need. If not, should I: Create a string field and build year-month concatenation (2017-01) Create a int field and build year-month concatenation (201701) Create two columns (one year and one month) Create a date column at the beginning of the month (2017-01-01 00:00:00) Something else? The objective is to run queries like (pseudo-SQL)

YYYY-MM column type in PostgreSQL

瘦欲@ 提交于 2020-11-29 08:18:24
问题 I need to a value associated to a month and a user in a table. And I want to perform queries on it. I don't know if there is a column data type for this type of need. If not, should I: Create a string field and build year-month concatenation (2017-01) Create a int field and build year-month concatenation (201701) Create two columns (one year and one month) Create a date column at the beginning of the month (2017-01-01 00:00:00) Something else? The objective is to run queries like (pseudo-SQL)

YYYY-MM column type in PostgreSQL

和自甴很熟 提交于 2020-11-29 08:18:14
问题 I need to a value associated to a month and a user in a table. And I want to perform queries on it. I don't know if there is a column data type for this type of need. If not, should I: Create a string field and build year-month concatenation (2017-01) Create a int field and build year-month concatenation (201701) Create two columns (one year and one month) Create a date column at the beginning of the month (2017-01-01 00:00:00) Something else? The objective is to run queries like (pseudo-SQL)