CREATE MULTISET TABLE employee( empno INTEGER, ename VARCHAR(50), deptno INTEGER, jobstart TIMESTAMP WITH TIME ZONE NOT NULL GENERATED ALWAYS AS ROW START, jobend TIMESTAMP WITH TIME ZONE NOT NULL AS GENERATED ALWAYS AS ROW END, PERIOD FOR SYSTEM_TIME(jobstart,jobend) ) PRIMARY INDEX(empno) WITH SYSTEM VERSIONING;
テーブルに以下の行が含まれているとします。
empno ename deptno jobstart jobend
----- ------ ------ -------------------------------- --------------------------------
1025 John 999 2005-02-03 12:12:12.123456+00:00 9999-12-31 23:59:59.999999+00:00
次のSELECT文の結果は次のとおりです。
SELECT empno,ename(CHAR(6)) FROM employee WHERE END(SYSTEM_TIME) IS UNTIL_CLOSED; empno ename ------ ------ 1025 John SELECT empno,ename(CHAR(6)) FROM employee WHERE END(SYSTEM_TIME) IS NOT UNTIL_CLOSED; *** Query completed. No rows found.