0
select count(*), entity_type from entities group by entity_type;
私は明らかにこのようなものを得ます:
:+----------+---------------+
| count(*) | entity_type |
+----------+---------------+
| 15418 | locations |
| 21789 | misc |
| 62306 | organizations |
| 121307 | people |
+----------+---------------+
は、私が欲しいのはこのようなものです
+----------+---------------+------+
| count(*) | entity_type | site |
+----------+---------------+------+
| 15418 | locations | ABC |
| 21789 | misc | ABC |
| 62306 | organizations | ABC |
| 121307 | people | ABC |
| 13418 | locations | CNN |
| 22789 | misc | CNN |
| 65306 | organizations | CNN |
| 132307 | people | CNN |
+----------+---------------+------+
このような種類のカウントを提供するには、どのようにクエリを設定できますか?
ヒント: 'JOIN'。そして再びJOINする。 –
...あなたの問題は何ですか?あなたは一緒に3つのテーブルを結合しようとしましたか? – Bakuriu