且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MySQL查找子字符串匹配项和按匹配项全词分组

更新时间:2022-02-07 21:20:18

您可以使用以下查询查找每个单词的计数.

You can use below query to find count of each word.

SELECT
sum(INSTR( '#beast' , TABLE.COL) > 0) '#beast',
sum(INSTR( '#beauty' , TABLE.COL) > 0) '#beauty'
FROM
TABLE

然后,如果需要,您可以透视表; MySQL数据透视表

Then you can pivot table if needed; MySQL pivot table