How to Upsert on Application-Time Periods?


I have table Application-Time Periods (

for example: CREATE TABLE Employees ( id INT UNSIGNED, name VARCHAR(255) not null, position VARCHAR(255) not null, age INT not null, annual_salary decimal(10, 2) not null, date_start DATE, date_end DATE, PERIOD FOR valid_period(date_start, date_end) ) ;

regular update will be for Application-Time Periods will be:

UPDATE Employees FOR PORTION OF valid_period FROM DATE '2019-03-01' TO DATE '9999-12-31' SET age = 34, position='Pre Marketing' WHERE id = 1;

How can i use INSERT ON DUPLICATE KEY UPDATE (Upsert) ( to Insert or update?

Regards, Gonen.


Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.