Index: openacs-4/packages/acs-kernel/sql/postgresql/rel-constraints-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/rel-constraints-create.sql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-kernel/sql/postgresql/rel-constraints-create.sql	14 Mar 2001 05:56:26 -0000	1.2
+++ openacs-4/packages/acs-kernel/sql/postgresql/rel-constraints-create.sql	14 Mar 2001 14:07:31 -0000	1.3
@@ -678,12 +678,12 @@
 -- DCW 2001-03-14.
 
 create view rc_segment_dependency_levels as
-      select rel_segment as segment_id,
-             max(tree_level) as dependency_level
+      select rc.rel_segment as segment_id,
+             max(rc.tree_level) as dependency_level
        from (select rc1.rel_segment, tree_level(rc1.tree_sortkey) as tree_level
                from rel_constraints rc1, rel_constraints rc2
               where rc1.tree_sortkey like rc2.tree_sortkey || '%'
-                and rc2.rel_side = 'two')
+                and rc2.rel_side = 'two') rc
    group by segment_id;
 
 --------------
