sql - Which customer has bought 4 or more items in our store? -


Which customer has bought 4 or more items in our store?

  select cutomer.cusName, COUNT (item name) as 'number of items' included on the customer's shop from customer INNER. Cusid = store.cusID by group cutomer.cusName;   

I'm not sure which product has purchased 4 or more items.

To get those customers, add HAVING clause

  SELECT cutomer.cusName, COUNT itemName (AS) 'item number' by customer.cusID = store.cusID group at customer INNER join store cutomer.cusName hosting number (itemName)> gt; 4 = /    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -