I have not much experience with JOINS and the result I get with query below isn't correct. I have a table called products and want to check if there are records in the table product_links. I only want to get a list of items that doesn't have rows in product_links.
When I run the below query, I only get one line. Anybody suggestions? Google couldn't help me or I'm searching with the wrong keywords.
SELECT a.id, a.SKU, a.title,
(SELECT COUNT(b.id) AS amount FROM product_links WHERE b.product=a.id) AS amount
FROM products AS a
LEFT JOIN product_links AS b ON b.product=a.id