たとえば、さまざまな方法でそれを行うことができます
ORDER BY SIGN(LOCATE('dog',content))+
SIGN(LOCATE('swim',content))+
SIGN(LOCATE('better',content)) DESC
またはCASEを使用
ORDER BY
CASE WHEN content LIKE '%dog%'
THEN 1
ELSE 0
END
+
CASE WHEN content LIKE '%swim%'
THEN 1
ELSE 0
END
+
CASE WHEN content LIKE '%better%'
THEN 1
ELSE 0
END
DESC