group by语句 SELECT ANAME,COUNT(BDATA) FROM (select B.ID BID,a.name ANAME,b.data BDATA from tab1 a,tab2 b where a.id=b.id) group by BID; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select b.id,count(b.data) from tab1 a,tab2 b where a.id=b.id group by b.id; 同意楼上不能存在非group by的列 不是多表的問題,而是使用group by后,select的字段必須是group by的字段或者是聚集的select a.id,b.name,sum(sl) from a,b where a.id=b.id group by a.id,b.name select a.name,(select count(data) from tab2 where id=a.id) from tab1 a; select a.name,(select count(data) from tab2 where id=a.id) from tab1 a; select a.name,count(*) from tab1 a,tab2 b where a.id=b.id group by a.name; 通过jdbc执行sql比在plsql中慢好多 sql语句问题 关于oracle procedure 的return问题 ORACLE10.1连接ORACLE8.17问题-急 求一条SQL语句 为什么不能配置 OMS?? 用UTL_SMTP包发送邮件时,如果邮件内容是中文,收到的内容就变成乱码,怎么办? 20/80原则与学习ORACL? 如何看oracle下一个用户的硬盘使用情况?比如它下面的表占有硬盘空间多大? 我把原来的一个数据库删了后,在SQL PLUS中登陆,竟然没有报错说没有初始化句柄。 新手问,Oracle 开发调查(见者有分) 求教oracle字符函数问题
不能存在非group by的列
select a.id,b.name,sum(sl) from a,b where a.id=b.id group by a.id,b.name