Skip to content
Advertisement

SQL query: count for all the reviews that each customer has written

Lets say I have one table called “REVIEWS”

This table has Reviews that customers have written for various products.

I would like to be able to get a “count” for all the reviews that each customer has written, so I write:

Now, my problem is that I wish to have a count like above BUT only for customers who have written a SPECIFIC product review

For instance,

In summary, I wish to be able to get the customers TOTAL COUNT for every review they have written, but ONLY for customers who have written a review for a specific product.

Advertisement

Answer

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement