SQL to select count of prices from distinct shopNames
I have a table with content similar to: date | shopName | product | price ----------------------------------------------- 20190701 | ShopA | Product 1 | 10.00 20190701 | ShopB | Product 1 | 15.00 20190708 | ShopA | Product 1 | 10.00 20190708 | ShopB | Product 1 | 15.00 ----------------------------------------------- I want a query that will select the COUNT(ALL) of each Product split on distinct ShopName If I do: SELECT DISTINCT date, shopName, product, COUNT(ALL price) as NumberOfPrices FROM table WHERE product = "Product 1"; I will get a record that gives me one result that contains the NumberOfPrices correctly, but will only have one shopName. How can I split the results into 2 records, 1 shopName per record each wit ha total of 2 NumberOfPrices? I am using SQLite if that matters.