We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c5f46b1 commit 1fd2b64Copy full SHA for 1fd2b64
MySQL/count-occurrences-in-text.sql
@@ -0,0 +1,8 @@
1
+# Time: O(n)
2
+# Space: O(n)
3
+
4
+SELECT "bull" AS word, SUM(IF(content LIKE "% bull %", 1, 0)) AS count
5
+FROM Files
6
+UNION ALL
7
+SELECT "bear" AS word, SUM(IF(content LIKE "% bear %", 1, 0)) AS count
8
+FROM Files;
0 commit comments