中我有一個表是這樣的:MySQL的 - 組一組
doctor_name | medicine
John a
John b
John a
John b
Kevin c
Kevin c
Kevin c
Kevin a
我想組雙方doctor_name
和medicine
。我的願望輸出是SELECT
這樣的:
doctor_name | medicine | COUNT(medicine)
John a 2
John b 2
Kevin a 1
Kevin c 3
我不知道如何使用正常GROUP BY
MySQL中做到這一點。真的很感謝有人能幫助我。