Hello I am a beginner at mysql. I have a table like this
|Item no.|Location|
-------------------
|192 |Japan |
|882 |Korea |
|982 |China |
|111 |China |
|02 |Japan |
|03 |Korea |
|04 |Japan |
I want the resulting table to be like this
|Location|NumberofItems|
------------------------
|Japan | 3 |
|Korea | 2 |
|China | 2 |
My code doesn't seem to work. Here is my code:
SELECT distinct Location, count(*) as NumberofItems FROM Products inner join Products on Price = Price