Oracle递归查询上下级数据

Oracle递归查询
查询下级数据时 start with child=? … prior child=parent
查询上级数据时关系调换,用 start with child=? … prior parent=child,其余数据不变

select num, nm from INFO where tp='Q' 
	connect by nocycle prior child = parent 
	start with child = '001';

nocycle的作用,是防止有数据本身child=parent,形成死循环

你可能感兴趣的:(oracle)