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
精彩评论