ich zwei Sätze von Ergebnissen haben:Wie union-Abfragen aus derselben Tabelle in MySQL
SELECT name, count(appearance) as countA from table where results = '1'
SELECT name, count(appearance) as countB from table where results = '2'
Und ich wollte, dass sie nebeneinander kombinieren, wie folgt aus:
+---------+---------+---------+
| col_1 | countA | countB |
+---------+---------+---------+
| John | 3 | 1 |
| Mary | 1 | 2 |
| Gary | 2 | NULL |
| Sean | 4 | NULL |
| Mike | NULL | 6 |
+---------+---------+---------+
Wie kann ich TU das?
Es funktioniert auch in MySql. –
Ja, das ist was ich suche. Danke^_ ^ – Khairul