全文搜索所有父项排成一行的类别

发布于 2024-09-03 04:56:26 字数 456 浏览 1 评论 0原文

全文搜索所有父项排成一行的类别: 猫等级1>> CatL2>>目录>> SearchedCategory

我的类别表中有 4 列:CatID、CatName、CatDepth、ParentID 有些类别的深度为 3 级,有些类别的深度为 7 级。 我想让目标类别及其所有父类别排成一排。

让我举个例子来解释一下:

搜索关键字:金属 搜索结果: 1:成品机械>机床、木材和机械工具金属加工机械>金属加工机械>金属弯曲机 2:非金属矿物>其他产品>>金属加工机械>金属弯曲机 3:非金属矿物>其他产品>>金属加工机械>金属铸造机械 ...

我尝试了很多方法来编写灵活的查询,但没有一个能按我的意愿工作。 任何善意的帮助将不胜感激。 谢谢 Kardo

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

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 as I wish.
Any kind help would be highly appreciated.
Thanks Kardo

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吖咩 2024-09-10 04:56:26

如果这是一个层次结构的物料清单,那么您可以使用

CONNECT BY 

返回层次结构(在 Oracle 中)

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

CONNECT BY 

to return the hierarchy (in Oracle)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文