I am looking for help in trying to solve an issue with a query.
Query:
SELECT distinct BRAND,(select count(distinct VIN) from STOCK) as STOCK ITEM COUNT
from STOCK
What I am trying to achieve is to display the brand and unique count of all VIN numbers which are located in each brand.
For some reason when I run the above query each brand eg, Ford,GM,TOYOTA, etc display the same count .
Or do a simple GROUP BY
:
SELECT BRAND, count(distinct VIN) as STOCK_ITEM COUNT
from STOCK
group by brand