LAST returns the last value of a derived period called jobduration created by the following SQL statement:
CREATE TABLE employee(id INTEGER,
name VARCHAR(50),
jdbegin DATE NOT NULL FORMAT 'YYYY-MM-DD',
jdend DATE NOT NULL FORMAT 'YYYY-MM-DD',
PERIOD FOR jobduration(jdbegin,jdend)
)PRIMARY INDEX(id);
When the following values are inserted into the employee table:
INSERT INTO employee(1025,'John',DATE'2011-01-02',DATE'2012-05-02');
the following SQL statement:
SELECT LAST (jobduration) FROM employee;
returns:
LAST(jobduration) ------------------------ 2012-05-01