How to find most popular word occurrences in MySQL?

后端 未结 6 2294
猫巷女王i
猫巷女王i 2021-02-13 11:38

I have a table called results with 5 columns.

I\'d like to use the title column to find rows that are say: WHERE title like \'%for sale%\

6条回答
  •  悲哀的现实
    2021-02-13 12:00

    SQL is not well suited for this task, While possible there are limitations (the number of words for example)

    a quick PHP script to do the same task may be easier to use long term (and likely quicker too)

     $count) {
        echo $word . " " . $count . PHP_EOL;
    }
    

    Output

    for 6
    sale 6
    and 2
    cheap 2
    house 2
    phones 1
    androids 1
    furniture 1
    cats 1
    cars 1
    dogs 1
    iphones 1
    

提交回复
热议问题