你的位置:首页 > 数据库

[数据库]常用Oracle语句

查看数据库版本:

1)select * from PRODUCT_COMPONENT_VERSION;

2)select * from v$version;

 

根据子节点查询所有的父节点:

SELECT X_LEVEL, X_ID FROM TAB_X START WITH X_ID = '子节点编号'CONNECT BY NOCYCLE PRIOR PARENTID = X_ID;

根据父节点查询所有子节点:

SELECT X_LEVEL, X_ID FROM TAB_X START WITH X_ID = '父节点编号'CONNECT BY NOCYCLE PRIOR X_ID = PARENTID;