构造一个sql语句 从一张表里面统计出来 同年同月出生的人的数量 如果写这样的一个slq语句 出生日期的格式如:2008-09-01 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select count(*) from user_table where to_char(birthday,'yyyy-mm-dd')='2008-09-01'; 例子如下:SELECT TRUNC(S.HIREDATE, 'mm'), COUNT(*) FROM SCOTT.EMP S GROUP BY TRUNC(S.HIREDATE, 'mm'); select birthday, count(*) from table1 group by birthday order by birthday select birthday, count(*) from table1 group by birthday having count(*)>1 order by birthday select count(*),birthday from table1 group by birthday order by to_date(birthday,'YYYY-MM-DD') select count(*) from tablename where to_char(colname,'yyyy-mm') = '2008-09'; 问题已解决:select count(substr(to_char(birthday,'yyyy-mm-dd',5,2))) from table group by substr(to_char(birthday,'yyyy-mm-dd',5,2)) oracle物化视图的问题 动态构造返回关系表达式的sql 客户端安装了PL/SQL,可以用dat文件来处理操作远程服务器端数据库吗 unix调用换成xp 命令行的调用? 多个进程同时同时读取一张表,如何保证不重复读呢? 新手,listener无法启动 小弟跪求!想导出oracle中一个表的部分列,请高手们帮忙啊 求存储过程的例子 存储过程报错,好奇怪 oracle 数据库存储过程怎么用传入参数作为查询条件? 求一联合sql语句,谢谢大家. 数据分组取值问题,看着简单分析出来难啊!(求助)
例子如下:
SELECT TRUNC(S.HIREDATE, 'mm'), COUNT(*)
FROM SCOTT.EMP S
GROUP BY TRUNC(S.HIREDATE, 'mm');
select count(substr(to_char(birthday,'yyyy-mm-dd',5,2))) from table group by substr(to_char(birthday,'yyyy-mm-dd',5,2))