开发者

SQL Count Function - Need some help

Looking for some help in making an SQL query where:

If the value per hour is more than 40 then it will count it and this count will display how many times开发者_如何学Go in that hour the value was above 40.

I am very new to SQL so please forgive my n00bness :)

Thanks!


SELECT Count(*) As myCount FROM myTable WHERE colPerHour > 40

This will return one row with a column called myCount. The value in that cell will be your desired number.


select colperhour, count (*)
from mytable
where colperhour > 40
group by colperhour 

This should give you each value of colperhour greater than 40 (which are in the table), along with the number of times each value exists

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜