Each time there will be a single number, record the member number and consumption
CodePudding user response:
SELECT shops,
T.,
COUNT (1) AS the number of
The FROM
(SELECT shops, membership number, COUNT (1) AS the number of the FROM table GROUP BY shops, members) t
GROUP BY shops,
T. number;