MAKE_DATE
Make a DATE value from three integer values that represent the year
, month
, and day
:
MAKE_DATE(year, month, day)
For example:
premdb=# CREATE TABLE season_dates
(seasonid INT, start_date DATE, end_date DATE);
CREATE TABLE
premdb=# INSERT INTO season_dates
VALUES(3, MAKE_DATE(1994, 8, 15), MAKE_DATE(1995, 5, 20));
INSERT 0 1
premdb=# SELECT * FROM season_dates;
seasonid | start_date | end_date
----------+------------+------------
3 | 1994-08-15 | 1995-05-20
(1 row)
Parent topic:Datetime Functions