表结构:
create table "KDCategory" (
"CategoryID" INTEGER not null,
"CategoryName" VARCHAR2(30),
"CategoryDesc" VARCHAR2(1024),
"ParentCategoryID" INTEGER,
"Deepth" INTEGER,
"Remark" VARCHAR2(1024),
"IDPath" VARCHAR2(1024),
"NamePath" VARCHAR2(1024),
"CategoryTag" VARCHAR2(100),
constraint PK_KDCATEGORY primary key ("CategoryID")
);
查询代码:
select * from Kdcategory connect by prior CategoryID=parentcategoryid start with CategoryID=2 order by categoryid