Open Source RDBMS - Seamless, Scalable, Stable and Free

English | Login |Register


1
(click on this box to dismiss)

CUBRID Hierarchical Queries

Suppose you have table representing a tree in the database. Something like:

TreeNode
Id, ParentId, Name

Is it possible to write a query in CUBRID to retrieve all the direct and indirect ancestors/predecessors of the specified tree node?

링크 댓글 쓰기 (0) 선택된 답변
질문시간 3년 전
swanotets
263
71 답변들
1

Standard SQL supports this already by using recursive common table expressions (CTEs). CUBRID supports CTEs by default. You may want to check out this link for reference: http://en.wikipedia.org/wiki/Hierarchical_query.

Additionally there is a great tutorial on Hierarchical Queries in CUBRID (PDF).

링크 댓글 쓰기 (0)
답변시간 3년 전
picador_jr
292




You are either using a very old browser or a browser that is not supported.
In order to browse cubrid.org you need to have one of the following browsers:



Internet Explorer: Mozilla Firefox: Google Chrome: