首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

查询不同月度不同客户的数据记录

2012-09-09 
查询不同月份不同客户的数据记录对于数据库不熟悉的需要对下面这个示例进行熟悉?select ordermonth 月份,c

查询不同月份不同客户的数据记录

对于数据库不熟悉的需要对下面这个示例进行熟悉

?

select ordermonth 月份,consignment 客户,sum(goodscount) 发货总数量,sum(volume) 发货总体积,sum(weight) 发货总重量
from
(
select SUBSTR(to_char(b.order_time,'YYYY-mm'),1,7) ordermonth,
b.goods_count goodscount,b.volume volume,b.weight weight,
b.consignment_id consignment
from bus_temp_order b
where b.order_time between sysdate-365 and sysdate)
group by ordermonth,consignment
order by consignment

热点排行