2012-04-11 38 views

回答

1

在SQL Server(和其他数据库一样),你将需要使用一个recursive common table表达,是这样的:

with some_tree as ( 
    select ... 
    union all 
    select ... 
) 
select * 
from t1 
where t1.id in (select some_id from some_tree); 

自11.2版本的Oracle不还支持递归公用表expresions(这样你就可以使用两个数据库的语法相同)