select count(*) from tbname group by trunc(regtime);
select count(*) from tbname group by trunc(regtime,'mm');
select count(*) from tbname group by trunc(regtime,'yyyy');
select count(*) from tbname group by trunc(regtime,'mm');
select count(*) from tbname group by trunc(regtime,'yyyy');
解决方案 »
- Oracle 补丁升级10.2.0.1---10.2.0.4
- 字符串比较的一点疑惑!
- I 不会 Oracle
- 8i导入oracle7数据的问题
- Oracle Managment Server 不能登录的问题?
- ****PLSQL Developer中编写的存储过程突然不能测试了,急
- Orcle学习用那本书好啊?
- 请问:如何将建立的用户赋予其建立表空间和存储过程的权利呢
- 网页上提交数据给Oracle服务器后,如何让远程的管理员得知有人提交了数据?
- ORACLE通过透明网关DBLINK查询SQLSERVER数据问题
- 能否在客户端同时装oracle8i和oracle9i,根据不同需要进行转换!
- 能用一条sql语句写出来吗?
count(*) month
--------------------------
5 2003-11
6 2003-12或:
name day
--------------------------
张三 2004-01-01
李四 2004-01-01
王五 2004-01-02
赵六 2004-01-02
select count(*),trunc(regtime,'mm') from tbname group by trunc(regtime,'mm');
select count(*),trunc(regtime,'yyyy') from tbname group by trunc(regtime,'yyyy');