如何从 SQL 列中的列表中查找单词

发布于 2025-01-16 14:07:20 字数 563 浏览 0 评论 0原文

所以我的例子会是这样的。假设我们有一个包含公司名称的表,但这些名称与地址混合在一起,有时还与首席执行官的名称混合在一起。例如:

Company
Some Company C++ Street
Alex Another Company JAVA Street
Boris Next Company

我有一个要从表中提取的公司名称列表。例如,我想获得另一家公司和下一家公司。我知道我可以这样做:

Select Company from DB where Company in('Another Company', 'Next Company')

但这只有在公司名称没有任何添加内容的情况下才有效。我怎样才能使它与示例表一起使用?请记住,我希望将公司名称硬编码到查询中,如上面的示例。我正在使用 Teradata。任何帮助将不胜感激!

So my exmaple will be like this. Let's say we have table that have company names, but the names are mixed with addresses and sometimes names of the CEO. For example:

Company
Some Company C++ Street
Alex Another Company JAVA Street
Boris Next Company

And I have a list of companies names that I want to extract from the table. For example I want to get Another Company and Next Company. I know that I can do it like this:

Select Company from DB where Company in('Another Company', 'Next Company')

but this only works if companies names are without any added stuff. How Can I make it work with example table ? Keep in mind that I want names of the companies hard-coded into query like example above. I'm using Teradata. Any help would be appreciated!

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文