我有以下查询:
SELECT *
from word
WHERE levenshtein(LOWER(name), LOWER('door')) <= 3
ORDER BY levenshtein(LOWER(name), LOWER('door')) ASC
LIMIT 5
问题是如何缓存(借助as)levenshtein
函数的结果以避免重复。
像
这样的东西SELECT *, levenshtein(LOWER(name), LOWER('door')) as distance...