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; 问个ORACLE 日期转换字符遇到的问题 Oracle有Cross-reference和CRUD分析工具吗? 反范式的管理 PROC预编译成功后,CC 时报的错,请高手看一下是什么问题?sunos5.9 在线等,马上结贴:在oracle中的PLSQL程序里把表的数据 导出 成为csv文件 取“销售组织::直销::物料组织<br>”中的“直销” 怎么能够授予用户授权的权限 求UNIX下的ORACLE好书,谢谢! 关于ORA卡硬盘一说 物料批次控制后,采购接收事务处理没有产生批次问题 新手问,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