Reputation: 351
For example, I have a table like this:
id | name | -------------------- 1 | T | 2 | Text | 3 | A | 4 | Text1 and Text | 5 | Txt |
, and I want to reverse match column with string, something like this:
select * from table_name where %name% like 'Text1 and Text2 and Text3'
, and to get these results:
id | name | ----------- 1 | T | 2 | Text | 4 | Text1 and Text |
How is that posible?
Upvotes: 2
Views: 479
Reputation: 28641
Try:
SELECT *
FROM table_name
WHERE 'Text1 and Text2 and Text3' LIKE '%'||name||'%'
UPD Here is my SQLFiddle with example: SQLFiddle.
Upvotes: 3