I use this SQL to grab some indexes:
select follow
from unigram
where alternativeSpelling like 'test'
order by freq desc
limit 10;
I then convert them to words using this SQL, one by one:
select word
from wordIdxTranslate
where word_idx = <one of the indexes from above>
How do I combine these to a single query, whil epreserving the ranking order from the first query (“freq”)?
Untested, but this should do it: