输入banner图图片脚本导航/分类

mysql-MYSQL查询问题,求助?

mysqlsql

图片说明

我想得到:
extension_id a(report_type=0) b(report_type=1)
4 0 1
5 1 1
6 2 0

求助sql语句如何写?