ビュー内に ORDER SIBLINGS BY fieldName を追加することは可能ですか? CONNECT BY 機能を使用してクエリを正常に使用している階層構造があります。
ただし、ビュー定義内に ORDER SIBLINGS BY fieldName を追加すると、Oracle は奇妙な括弧エラーを返します。
drop view myview;
create view myview as (
select id, level as depth, label, parentid, orderhint,
connect_by_root myfield1 "myfield1", connect_by_root id "toplevelparentid"
from mytable
connect by prior id = parentid
start with id in (select id from mytable where parentid is null)
order siblings by orderhint
);
ORDER SIBLINGS BY またはビュー定義の外にない場合、それは魅力のように機能します。そうでなければ、私は得る:
ORA-00907: 右括弧がありません