SELECT app, result, COUNT(*) AS cnt
FROM table
GROUP BY app, result
下一个返回我:
app|result|cnt|
ap1|FAIL |111|
ap1|PASS |99 |
ap2|FAIL |222|
ap3|PASS |333|
但我需要这样:
app|cnt_FAIL|cnt_PASS|
ap1|111 |99 |
ap2|222 |0 |
ap3|0 |333 |