搜索字符串结束部分在Postgres中

发布于 2025-02-09 07:08:13 字数 453 浏览 2 评论 0原文

我需要找到具有相同决赛的记录:

http://www.a.com/a.a.a.com/a.html_art123 http://www.b.com/b.html_art123

最终部分“ Art123” IS记录有什么区别。 我正在使用split_part,但是查询太慢。

还有另一种解决这个问题的方法吗?

split_part('http://www.a.com/a.html_art124', '_', 2)
art124

I need to find records that have the same final:

http://www.a.com/a.html_art123
http://www.b.com/b.html_art123

the final part "art123" is what differences the record.
i'm using split_part but the query is too slow.

is there another way to solve this ?

split_part('http://www.a.com/a.html_art124', '_', 2)
art124

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

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

发布评论

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

评论(1

杀お生予夺 2025-02-16 07:08:13

也许您可以在查询中使用类似的操作员。

类似的内容:

SELECT * FROM TABLE WHERE COLUMN LIKE '%art123' 

%匹配该字段的任何零或更多字符的顺序。

Maybe you can use the LIKE operator in your query.

Something like this:

SELECT * FROM TABLE WHERE COLUMN LIKE '%art123' 

The % matches any sequence of zero or more characters of that field.

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