欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

oracle数据库sql语句之join实例讲解

程序员文章站 2022-04-08 10:40:39
--group by select deptno,count(*) from emp group by deptno; --group by ... having selec...

--group by

select deptno,count(*) from emp group by deptno;

--group by ... having

select deptno, count(*) from emp group by deptno having count(*)>=5;

--join

select * from emp join dept on emp.deptno = dept.deptno;

--join right

select * from emp right join dept on emp.deptno = dept.deptno;