DATEDIFF():返回两个日期差的天数 SELECT DATEDIFF(NOW(),'2000-08-11') AS time_long; 测试截图 #查询部门编号为90的部门的员工个数 SELECT COUNT(*),department_id FROM employees WHERE department_id=90; #----------- SELECT COUNT(*),department_id FROM employees GROUP BY department_id HAVING department_id=90 测试截图