Oracle ORA-00979-“使用GROUP BY表达式”。
技术问答
138 人阅读
|
0 人回复
|
2023-09-13
|
有人能帮我具体查询吗?当我试图操作这个命令时,我遇到了它ORA-00979:5 G* Z8 y6 H4 e! I3 y: \3 a6 X
select t0.title,count (1) as count0,(select count from contract c1,se se where c1.c_id = se1.c_id and se1.svc_id = 3 and se1.deleted = 0 and c1.deleted = 0 and c1.c_date between to_date ('07.10.2000','dd.mm.yyyy and to_date ('22.11.2010','dd.mm.yyyy and c1.company = 0 and c1.tdata.tariff = c0.tdata.tariff ) as count1 from contract c0,se se0,tariff t0 where c0.c_id = se0.c_id and se0.svc_id = 3 and se0.deleted = 0 and c0.deleted = 0 and c0.c_date between to_date ('21.11.2000','dd.mm.yyyy and to_date ('06.01.2011','dd.mm.yyyy') and c0.company = 0 and t0.tariff_id = c0.tdata.tariff group by t0.title
* I. c; b9 D& K& D2 ~, l 解决方案:
# ~7 l4 `) o2 P6 b' |0 J 问题是您的selectcount(1)零件的子查询。仅仅因为它包含一个计数,它实际上不能成为一个总结。它仍然是一个子查询,将应用于每行,您可以看到它使用的值c0.tdata.tariff不属于组。 |
|
|
|
|
|