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
Post a Comment