一、序列
创建序列
create sequence NST_BRANCH_QKS_SEQ
increment by 1
start with 1
nomaxvalue
nominvalue
cache 20;
根据序列名查询序列
select * from user_sequences where sequence_name = 'NST_BRANCH_QKS_SEQ';
二、数据回滚
将数据库数据回滚到之前某个时间段
alter table AABBC enable row movement
flashback table AABBC to timestamp to_timestamp('2023-01-17 14:10:00','yyyy-mm-dd hh24:mi:ss')
alter table AABBC disable row movement
获取指定时间的数据
SELECT * FROM AAA AS OF TIMESTAMP TO_TIMESTAMP('2023-01-30 17:20:00','yyyy-mm-dd hh24:mi:ss') WHERE A = 'a';
三、数据库系统
查看系统时间
select Current_date from dual;
设置时间字段默认时间为系统时间
alter table A modify CREATE_TIME DATE default sysdate;
四、其它
查看变量长度
select lengthb('中国') from dual;