CodePudding user response:
https://zhidao.baidu.com/question/163677345.htmlCodePudding user response:
https://zhidao.baidu.com/question/163677345.htmlCodePudding user response:
The following SQL to be able to solve the basic problem, but the dog how to intercept this string as: dog, do, og, g.o?SELECT *
The FROM (SELECT *,
CASE
The WHEN words LIKE '% % dog THEN
1
The WHEN words LIKE '% og %' THEN
2
The WHEN words LIKE '% g %' THEN
3
The WHEN words LIKE '% o %' THEN
4
END AS an rn
FROM the test
Dog WHERE words LIKE '% %'
Og the OR words LIKE '% %'
OR words LIKE '% g %'
OR words LIKE '% o %) AS k
The ORDER BY rn);