开发者

SQL Query too add up how many times a unique string occurs

开发者 https://www.devze.com 2023-02-17 17:49 出处:网络
For example if I was creating a Pizza shop database 开发者_JAVA百科it would look like this SELECT pizza_type, COUNT(*) as \'NumberOrdered\'

For example if I was creating a Pizza shop database 开发者_JAVA百科it would look like this

SQL Query too add up how many times a unique string occurs


SELECT pizza_type, COUNT(*) as 'NumberOrdered'
FROM table
GROUP BY pizza_type


Look at the COUNT() function and GROUP BY

select pizza_type, count(*) as NumberOrdered
from orders
group by pizza_type
0

精彩评论

暂无评论...
验证码 换一张
取 消