SQL的问题--group by(50分)

  • 主题发起人 主题发起人 summer620
  • 开始时间 开始时间
S

summer620

Unregistered / Unconfirmed
GUEST, unregistred user!
select a3.nename_cn 局名,a4.name 中继群名,SUM(ADL_TKG_OG.ANSW) 应答次数,
SUM(ADL_TKG_OG.ASSGD) 安装电路数 from adl_tkg_og,TKG_config a2,ne_config a3,
gene_stddata a4 where a4.name in ('出大区省际一级电路群','国际电路群','际专电路群')
and a4.code=a2.tkglevel and a2.tkgid=adl_tkg_og.tkgid and a3.nename=adl_tkg_og.nename
and a3.NENAME_cn in ('S11') and
(ADL_TKG_OG.YEAR||ADL_TKG_OG.MONTH||ADL_TKG_OG.DAY||ADL_TKG_OG.FROM_HOUR||ADL_TKG_OG.FROM_MIN)
BETWEEN 200112201600 and 200112201600 and a4.idt='TKGLEVEL' group by a3.nename_cn

这里的group by 用错了吗?当我加group by 时
提示错误:不是group by 表示式
当我不加这个时,提示错误:非单组分组函数

请问是怎么回事?
 
group by a3.nename_cn,a4.name
 
是否应加上 group by adl_tkg_og.answ,adl_tkg_og.assgd,a3.nename_cn
 
(ADL_TKG_OG.YEAR||ADL_TKG_OG.MONTH||ADL_TKG_OG.DAY||ADL_TKG_OG.FROM_HOUR||ADL_TKG_OG.FROM_MIN)
BETWEEN 200112201600 and 200112201600

((ADL_TKG_OG.YEAR||ADL_TKG_OG.MONTH||ADL_TKG_OG.DAY||ADL_TKG_OG.FROM_HOUR||ADL_TKG_OG.FROM_MIN)
BETWEEN 200112201600 and 200112201600)
 
group by 的句子换成下面的试试
group by a3.nename_cn, a4.name
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
680
import
I
S
回复
0
查看
928
SUNSTONE的Delphi笔记
S
后退
顶部