--查询本周一 格式yyyy/mm/dd
select trunc(next_day(sysdate-8,1)+1) as 周一 from dual;
---------------------------------------------------------------------------------------------------------------------------------
--索引定义
索引是用来快速地寻找那些具有特定值的记录。通过索引,可以使程序很快找到数据库中的数据,不需要扫描整个数据库。
--索引分类
逻辑上:
Single column 单列索引
Concatenated 多列索引
Unique 唯一索引
NonUnique 非唯一索引
Function-based函数索引
Domain 域索引
物理上:
Partitioned 分区索引
NonPartitioned 非分区索引
B-tree:
Normal 正常型B树
Rever Key 反转型B树
Bitmap 位图索引
---------------------------------------------------------------------------------------------------------------------------------
oracle实现递归查询(举例说明)
1.建表加数据:
2.需求:查询A节点和B节点的全部子节点的NUM和?
A = 3+5+7=15
B = 4+6=10
3.甩脚本:
SELECT T.*, ROWID FROM TAB T;
select C_NAME,
(select sum(NUM)
from TAB t
where t.p_name <> '0'
start with C_NAME = t1.C_NAME
connect by P_NAME = prior C_NAME) NUM
from TAB t1
where t1.P_NAME = '0';
4.上结果: