Вы можете использовать условное агрегирование:
select hk_district,
sum(complaint_no) filter (where month = '201801') as compaints_201801,
sum(complaint_no) filter (where month = '201802') as compaints_201802,
sum(complaint_no) filter (where month = '201803') as compaints_201803
from t
group by hk_district;