update t2 for portion of apptime from '2000-01-01' to '2018-01-01'
set id=id + 6;
select * from t2;
id s e
1 1999-01-01 2000-01-01
1 1999-01-01 2000-01-01
1 2018-01-01 2018-12-12
1 2018-01-01 2019-01-01
10 2016-01-01 2018-01-01
11 2010-01-01 2015-01-01
2 1998-01-01 2000-01-01
2 2018-01-01 2018-12-12
3 1997-01-01 2000-01-01
4 2018-01-01 2020-01-01
7 2000-01-01 2017-01-01
7 2000-01-01 2018-01-01
7 2017-01-01 2018-01-01
8 2000-01-01 2018-01-01
9 2000-01-01 2015-01-01
select * from log_tbl order by id;
id log
1 >INS: 1, 1999-01-01, 2000-01-01
2 <INS: 1, 1999-01-01, 2000-01-01
3 >INS: 1, 2018-01-01, 2018-12-12
4 <INS: 1, 2018-01-01, 2018-12-12
5 >INS: 1, 1999-01-01, 2000-01-01
6 <INS: 1, 1999-01-01, 2000-01-01
7 >INS: 1, 2018-01-01, 2019-01-01
8 <INS: 1, 2018-01-01, 2019-01-01
9 >INS: 2, 1998-01-01, 2000-01-01
10 <INS: 2, 1998-01-01, 2000-01-01
11 >INS: 2, 2018-01-01, 2018-12-12
12 <INS: 2, 2018-01-01, 2018-12-12
13 >INS: 3, 1997-01-01, 2000-01-01
14 <INS: 3, 1997-01-01, 2000-01-01
15 >INS: 4, 2018-01-01, 2020-01-01
16 <INS: 4, 2018-01-01, 2020-01-01
select * from t for portion of apptime from 0 to 1 for system_time all;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'portion of apptime from 0 to 1 for system_time all' at line 1
update t for portion of apptime from 0 to 1 for system_time all set id=1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'system_time all set id=1' at line 1
create or replace table t (id int, str text, s date, e date,
period for apptime(s,e));
insert into t values(1, 'data', '1999-01-01', '2018-12-12');
insert into t values(1, 'other data', '1999-01-01', '2018-12-12');
update t for portion of apptime from '2000-01-01' to '2018-01-01'
set id= id + 5;
select * from t;
id str s e
1 data 1999-01-01 2000-01-01
1 data 2018-01-01 2018-12-12
1 other data 1999-01-01 2000-01-01
1 other data 2018-01-01 2018-12-12
6 data 2000-01-01 2018-01-01
6 other data 2000-01-01 2018-01-01
# multi-table UPDATE is impossible
create or replace table t1(x int);
update t for portion of apptime from '2000-01-01' to '2018-01-01', t1
set t.id= t.id + 5;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' t1
set t.id= t.id + 5' at line 1
update t1 set x= (select id from t for portion of apptime from '2000-01-01' to '2018-01-01');
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'portion of apptime from '2000-01-01' to '2018-01-01')' at line 1