select m, p from ... where u = N group by m, p order by m, p;