select count(time_column) from your_table group by year(from_unixtime(time_column))或者by month(from_unixtime(time_column))或者dayofyear(from_unixtime(time_column))from_unixtime: 时间戳转时间unix_timestamp: 时间转时间戳
不高,用EXISTS替代IN、用NOT EXISTS替代NOT IN: (高效)SELECT * FROM EMP (基础表) WHERE EMPNO > 0 AND EXISTS (SELECT ‘X' FROM DEPT WHERE DEPT.DEPTNO = EMP.DEPTNO AND LOC = ‘MELB') (低效)SELECT * FROM EMP (基础表) WHERE EMPNO > 0 AND DEPTNO IN(SELECT DEPTNO...