开发者

Full-Text Search for category with all parents in a row

开发者 https://www.devze.com 2023-01-01 04:39 出处:网络
Full-Text Search for category with all parents in a row: CatLevel1 >> CatL2 >> CatLn >> SearchedCategory

Full-Text Search for category with all parents in a row: CatLevel1 >> CatL2 >> CatLn >> SearchedCategory

I've got 4 columns in my category table: CatID, CatName, CatDepth, ParentID Some categories got a 3 level depth and some other 7. I want to have the target category with all its parents in one row.

Let me explain by an example:

Searched Keyword: metal Search Result: 1: Finished Machinery > Machine Tools, Wood & Metalworking Machinery > Metal Processing Machinery > Metal Bending Machinery 2: Non-Metallic Minerals > Other Products > Metal Processing Machinery > Metal Bending Machinery 3: Non-Metallic Minerals > Other Products > Metal Processing Machinery > Metal Casting Machinery ...

I tried many ways to write a flexible query, but none of them work a开发者_如何转开发s I wish. Any kind help would be highly appreciated. Thanks Kardo

[ekardo]-[at]-[gmail]-[dot]-[com]


If this is a hierarchic Bill of Materials, then you could use

CONNECT BY 

to return the hierarchy (in Oracle)

0

精彩评论

暂无评论...
验证码 换一张
取 消