例如,我有一个这样的表:
id | name | -------------------- 1 | T | 2 | Text | 3 | A | 4 | Text1 and Text | 5 | Txt |
,我想用字符串反转匹配列,如下所示:
select * from table_name where %name% like 'Text1 and Text2 and Text3'
,并获得这些结果:
id | name | ----------- 1 | T | 2 | Text | 4 | Text1 and Text |
这是怎么回事?
答案 0 :(得分:3)
尝试:
SELECT *
FROM table_name
WHERE 'Text1 and Text2 and Text3' LIKE '%'||name||'%'
UPD这是我的SQLFiddle示例:SQLFiddle。