开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜