我正在用MonetDB做一些测试。我尝试执行的查询要点(使用借来的语法)如下所示:SELECT mystring FROM mytable WHERE mystring REGEXP 'myxpression';
MonetDB不支持这种语法,但是docs声称它支持PCRE,所以这可能是可能的,但语法仍然无法实现。
发布于 2018-02-14 11:48:50
实现在MonetDB后端,实现它的模块是pcre (可以在MonetDB5源代码树中找到)。我不确定MonetDB/SQL默认情况下是否可用。 如果不是,使用这两个函数定义,可以将SQL函数链接到MonetDB5中的各个实现:
-- case sensitive create function pcre_match(s string, pattern string) returns BOOLEAN external name pcre.match;-- case insensitive create function pcre_imatch(s string, pattern string) returns BOOLEAN external name pcre.imatch;If you need more, I'd suggest to have a look at MonetDB5/src/modules/mal/ pcre.mx in the source code.使用select name from sys.functions;检查函数是否存在,否则需要创建它。
例如,您可以这样使用pcre_imatch():
SELECT mystring FROM mytable WHERE pcre_imatch(mystring, 'myexpression');https://stackoverflow.com/questions/48772593
复制相似问题