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

ora-00979!!急求
select mc.f_key,(select sum(sa.f_r-fsa.f_i) from c_sa),(select count(sa.f_r-fsa.f_i) from c_sa)
  from 
  zhangwl.c_sa sa,
  zhangwl.c_sa fsa,  
  zhangwl.c_MC mc 
  group by mc.f_key
ora-00979不是GROUP BY表达式

------解决方案--------------------
SQL code

--你連關聯倏件都沒有,哥們你想做什麼
select mc.f_key,a.sum1,a.count1
  from  
  zhangwl.c_sa sa,
  zhangwl.c_sa fsa,   
  zhangwl.c_MC mc,
(select sum(sa.f_receivetime-fsa.f_issuetime) sum1,count(sa.f_receivetime-fsa.f_issuetime)count1
 from zhangwl.cr_lwms_sa) a
  group by mc.f_key;