Count number of rows added last hours Mysql

By October 10, 2016MYSQL, PHP

The following query display the count number of rows added last hours Mysql.

SELECT 
  COUNT(*) AS cnt 
FROM
  `user` `ur` 
WHERE ur.added_time >= DATE_SUB(NOW(), INTERVAL 1 HOUR);

SELECT DATE_SUB(NOW(), INTERVAL 1 HOUR);

Output
count

Pankaj Singh Sugara

Author Pankaj Singh Sugara

More posts by Pankaj Singh Sugara