mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
SQL: derived SYSTEM_TIME clash detection [closes #371]
This commit is contained in:
@@ -42,7 +42,26 @@ from emp for system_time as of timestamp @ts_1 as e,
|
||||
ancestors as a
|
||||
where e.mgr = a.emp_id
|
||||
)
|
||||
select * from ancestors for system_time as of current_timestamp;
|
||||
select * from ancestors;
|
||||
emp_id name mgr salary
|
||||
1 bill NULL 1000
|
||||
20 john 1 500
|
||||
30 jane 1 750
|
||||
with recursive
|
||||
ancestors
|
||||
as
|
||||
(
|
||||
select e.emp_id, e.name, e.mgr, e.salary
|
||||
from emp as e
|
||||
where name = 'bill'
|
||||
union
|
||||
select e.emp_id, e.name, e.mgr, e.salary
|
||||
from emp as e,
|
||||
ancestors as a
|
||||
where e.mgr = a.emp_id
|
||||
)
|
||||
select * from ancestors
|
||||
for system_time as of timestamp @ts_1;
|
||||
emp_id name mgr salary
|
||||
1 bill NULL 1000
|
||||
30 jane 1 750
|
||||
|
Reference in New Issue
Block a user