【发布时间】:2020-11-16 05:50:02
【问题描述】:
我有一个这样的基本书籍表:
CREATE TABLE books (
id integer primary key,
name text not null
);
INSERT INTO books (id, name) VALUES (1, 'The Ghost');
我想搜索与搜索词 ^The Ghost$ 匹配的书名。如您所见,该术语中有一些正则表达式。如何通过正则表达式进行匹配?
我试过这样做,但没有结果
select *
from books
WHERE name like '%^The Ghost$%'
【问题讨论】:
标签: sql regex postgresql select