排序
空值排序
- Oracle将NULL作为无限大,MySQL将NULL作为无限小
- Oracle order NULL LAST by default
- How ORDER BY and NULL Work Together in SQL
WITH
语法
1 | with w_dual as ( |
保留最新数据
1 | delete from T_TZZ_TZZ_MEMBER where id in ( |
PARTITION BY
初始化分组编号
1 | UPDATE omc_om_wtsafety a SET a.safetynum = ( |
获取最新记录
1 | update T_GUANGGAO_NR a set UPDATED_AT = ( |
Hierarchical Queries
START WITH
specifies the root row(s) of the hierarchy.CONNECT BY
specifies the relationship between parent rows and child rows of the hierarchy.ORDER SIBLINGS BY
preserve ordering within the hierarchy.CONNECT_BY_ROOT
SYS_CONNECT_BY_PATH
1 | select last_name, employee_id, manager_id, level |
参考
DATABASE LINK
CREATE DATABASE LINK
1 | (DESCRIPTION = |