如何将数据作为表存储在表中? (SQL Server) [英] How can I store data in a table as a trie? (SQL Server)

查看:150
本文介绍了如何将数据作为表存储在表中? (SQL Server)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了使事情变得更简单,该表包含英语词典中的所有单词。

To make things easier, the table contains all the words in the English dictionary.

我想做的就是能够将数据作为特里存储。这样,我可以遍历trie的不同分支并返回最相关的结果。

What I would like to do is be able to store the data as a trie. This way I can traverse the different branches of the trie and return the most relevant result.

首先,如何将数据作为trie存储在表中?

First, how do I store the data in the table as a trie?

第二,如何遍历树?

如果有帮助,请使用这个先前的问题是这个问题的发源地。

If it helps at all, the suggestion in this previous question is where this question was sparked from.

请确保我们正在谈论的是SQL。由于有指针,我了解了 Mike Dunlavey的C实现,但看不到这部分的内容(

Please make sure it's SQL we're talking about. I understood the Mike Dunlavey's C implementation because of pointers but can't see how this part (The trie itself) works in SQL.

谢谢,

马特

Thanks,
Matt

推荐答案

您可以使用层次结构ID使用SQL Server 2008为数据层次结构建模。请参阅此MSDN杂志参考

You model your data hierarchies with SQL Server 2008 using hierarchy id. See this MSDN magazine reference.

这篇关于如何将数据作为表存储在表中? (SQL Server)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆