SELECT All rows and count from another table
I have this code, my table structure is Products Table and Clicks table. What I want is to list all my products and with a count click how many times they've clicked which is a count from another table with number of rows for that product ID.
This only shows the products that have a row in the clicks table.
new products or un-clicked products don't show.
SELECT RP.ProductName, COUNT(RC.ProductID) FROM `retail_products` RP
JOIN retail_clicks as RC on RC.ProductID = RP.ID
GROUP BY RP.ProductName