41. +----+--------------------+
Map | id | text |
+----+--------------------+
| 1 | to be or not to be |
+----+--------------------+
◎ レコ`ドをB訶篩个箸靴 Map へ ◎
+----+---------+-------+
| id | key | value |
+----+---------+-------+
| 1 | to | 1 |
| 2 | be | 1 |
| 3 | or | 1 |
| 4 | not | 1 |
| 5 | to | 1 |
| 6 | be | 1 |
+----+---------+-------+
42. +----+--------------------+
Map | id | text |
+----+--------------------+
| 1 | to be or not to be |
+----+--------------------+
◎ レコ`ドをB訶篩个箸靴 Map へ ◎
+----+---------+-------+
| id | key | value |
+----+---------+-------+
| 1 | to | 1 |
| 2 | be | 1 |
| 3 | or | 1 |
| 4 | not
value には JSON で秘れるので | 1 |
| 5 | to
夛晒デ`タも聞喘辛嬬 | 1 |
| 6 | be | 1 |
+----+---------+-------+
43. +----+---------+-------+
| id | key | value |
Shuf?e +----+---------+-------+
| 1 | to
| 2 | be
| 1
| 1
|
|
| 3 | or | 1 |
| 4 | not | 1 |
| 5 | to | 1 |
| 6 | be | 1 |
+----+---------+-------+
◎ キ`で GROUP BY して ◎
SELECT ◎ 、 GROUP_CONCAT ◎
`key`, +---------+--------+
GROUP_CONCAT(`value`) | key | values |
FROM +---------+--------+
`嶄gテ`ブル` | be | 1,1 |
| not | 1 |
GROUP BY | or | 1 |
`key` | to | 1,1 |
+---------+--------+
44. +---------+--------+
| key | values |
Reduce +---------+--------+
| be | 1,1 |
| not | 1 |
| or | 1 |
| to | 1,1 |
+---------+--------+
◎ キ`と、療篩个 Reduce へ ◎
+----+---------+-------+
| id | key | count |
+----+---------+-------+
| 1 | be | 2 |
| 2 | not | 1 |
| 3 | or | 1 |
| 4 | to | 2 |
+----+---------+-------+
45. +---------+--------+
| key | values |
Reduce +---------+--------+
| be | 1,1 |
| not | 1 |
| or | 1 |
gHにはデリミタとして個佩を聞喘| to | 1,1 |
+---------+--------+
個佩曝俳りの JSON になる
◎ キ`と、療篩个 Reduce へ ◎
+----+---------+-------+
| id | key | count |
+----+---------+-------+
| 1 | be | 2 |
| 2 | not | 1 |
| 3 | or | 1 |
| 4 | to | 2 |
+----+---------+-------+