SELECT inst, count(*)
FROM student, team
WHERE student.student_code = team.student_code(+) AND leibie=1
GROUP BY inst
FROM student, team
WHERE student.student_code = team.student_code(+) AND leibie=1
GROUP BY inst
解决方案 »
- oracle数据库还原
- 做分布式事务时连接到oracle数据库报错,MSSQL是可行的
- alter database datafile 4 online;显示需要执行介质恢复?
- 正打算学习oracle请问哪一个版本适合
- oracle引用计算列
- redhat9安装oracle9.2出现错误
- 存储过程报错
- 有两台服务器,分别安装两个不同的数据库ncdc和ncdz,现在在ncdc的库中写一个存储过程
- oracle中如何用FORALL实现动态SQL的批量插入,我按书上的例子行不通
- 对ORACLE和SqlServer都有认识的朋友请帮忙!
- 小弟自己写的触发器,请问错在那里?
- ******这条SQL为什么不能执行,解决立即给分*****
FROM student, team
WHERE student.student_code = team.student_code AND leibie=1
GROUP BY inst
having count(*)>=0
FROM student, team
WHERE student.student_code = team.student_code AND leibie=1
GROUP BY inst
union
select distinct inst,0
from student
where not exists(
select 1 from team where student.student_code = team.student_code AND leibie=1
)
楼楼上的改成:
SELECT inst, count(*)
FROM student, team
WHERE student.student_code = team.student_code(+) AND leibie(+)=1
GROUP BY inst
就可以了,
但我还想求 是普通会员或是黄金会员的人数
WHERE student.student_code = team.student_code(+) AND leibie(+) IN {1,2}
就不可以了,
WHERE student.student_code = team.student_code(+) AND leibie(+) IN {1,2}
就不可以了