查询代码:
SELECT * FROM example WHERE name LIKE '%test%' OR SOUNDEX(name) LIKE 'T230%' OR SOUNDEX(name) LIKE 'T23%'
我想先展示与之匹配的结果 WHERE name LIKE '%test%' 之后呢 SOUNDEX(name) LIKE 'T230%' 最后一行是 SOUNDEX(name) LIKE 'T23%' 谢谢你的关注。
WHERE name LIKE '%test%'
SOUNDEX(name) LIKE 'T230%'
SOUNDEX(name) LIKE 'T23%'
wwtsj6pe1#
可以在中使用布尔表达式 order by . “true”被视为“1”,false被视为“0”。所以:
order by
ORDER BY (name LIKE '%test%') DESC, (SOUNDEX(name) LIKE 'T23%') DESC, (SOUNDEX(name) LIKE 'T230%') DESC
1条答案
按热度按时间wwtsj6pe1#
可以在中使用布尔表达式
order by
. “true”被视为“1”,false被视为“0”。所以: