I have to tables:

INVENTORY(INT id, varchar location, varchar bin_name, bigint barcode, int amount, varchar operator_id)
-location=location of a store
-bin_name=name of a shelf the product is on
-barcode=products barcode
-amount=the amount of products with current barcode un current shelf
-operator_id=data uploader id

BIN(INT id, varchar location, bin_name)
-location=location of a store
-bin_name=name of a shelf the product is on
*note that shelf names are repeated because many locations can have shelfs with the same name.

i want to get the result as following

+---------+--------------------------------------------------------+
| Shelf | Amount unique product barcodes scanned on shelf |
+---------+--------------------------------------------------------+
| VIT-1-3 | 146 |
+---------+--------------------------------------------------------+

in the column 'Shelf' I want to list all shelfs in a location
in the second column count of unique barcodes scanned

i came up with

select a.bin_name as 'Shelf', (select count(*) from inventory as b where b.bin_name=a.bin_name) as 'Amount' from bin as a
where a.location='JE'

i get the first column right but the second one returns 0 but if i try the subquery by itself giving it a certain bin_name it works.

How can i accomplish what i need?