读书人

这货色能用子查询查出来吗

发布时间: 2014-05-27 16:56:28 作者: rapoo

这东西能用子查询查出来吗?
现在有表结构及数据如下:


[解决办法]
12年7月份18点到20点的number总和
建议使用to_char实现
to_char(date,'yyyy-mm')='2012-07'
to_char(date,'hh24')>=18 and to_char(date,'hh24')<=20
即:

select sum(number) from 表名 where to_char(date,'yyyy-mm')='2012-07' and
to_char(date,'hh24')>=18 and to_char(date,'hh24')<=20

读书人网 >oracle

热点推荐