文字列の配列と、テキスト型の列を持つテーブルがあります。テーブルの任意の行の指定した列に、どの文字列がいくつ出現したかを一覧表示したい。1つのクエリでこれを行う方法はありますか?
Example;
$strings = array('test', 'sth');
Table;
id | someTextColumn
-------------------
1 | abc tests
2 | sthab
3 | teststh
4 | abcd
5 | sth
Expected result;
str | occurences
-----------------
test | 2
sth | 3