删除指定时间以前的数据
delete from 表名 where 字段名 <TO_DATE ('2018-05-11', 'yyyy-MM-dd')
删除表内所有数据~truncate
truncate table 表名
合并两张表的数据----(前提是两张表中的字段都相等~union)
select a.name,a.age,a.adress from student a where +条件 union select b.name,b.age,b.adress from student b where +条件
排序新功能---
ROW_NUMBER () OVER ( PARTITION BY 字段1,字段2,字段3 ORDER BY 字段4 DESC )
解释:ROW_NUMBER () ------为每一条分组记录返回一个数字
row_number() OVER (PARTITION BY COL1 ORDER BY COL2)
------ 表示根据COL1分组,在分组内部根据 COL2排序,而此函数计算的值就表示每组内部排序后的顺序编号
SELECT
BILL_ORG_CODE,
ADJUST_TIME,
END_TIME,
BEGIN_TIME,
ROW_NUMBER () OVER (PARTITION BY BILL_ORG_CODE,BEGIN_TIME,END_TIME ORDER BY ADJUST_TIME DESC) RN
FROM
YTRPT.T_ORD_ACCEPTE_OPERATE_INFO UU