日期:2014-05-17  浏览次数:21634 次

oracle 用sum统计 怎么让一些需要查询的字段 不进行group by
 date    name   neo    amt
2013/04/18  AAA  B1     121
2013/04/18  bbb  b1      212
2013/04/17  ccc  b1      213
2013/04/18  ddd  b2      232
2013/04/18  eee  b2      211

我只想按neo分组统计,但是也要查询date name 

select date,name,neo,sum(amt) from table proup by neo 

但是 这样写会报错,group by必需 加上 date name  求解

------解决方案--------------------
select adate,aname,neo,sum(amt) over(partition by neo) from tmp