Help with SQL query -


Let's say I have a table called "REVIEWS"

In this table, that review For whom the customers have written various products.

I want to be able to get "count" for all reviews written by each customer, so I write:

  SELECT count (*) AS counter From reviews WHERE customers_id = 12345  

Now, my problem is that I want to count as above, but only for customers who have written a particular product review

For example, select

  select from customers_review review WHERE products_id = '170'  

Sarah The word, I wrote a review for the customers to be able to achieve total COUNT say he wrote to every review, but only looked at a particular product to those customers.

Thank you very much for your help.

  select customer_itit, count (*) from reviews where customers_id (c select reviews from ustomers_id Where products_id = '170') group by customers_id;  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -