sql92和sql99比较
1.功能方面:sql99支持的较多
2.可读性:sql99实现了链接条件和筛选条件的分离,所以可读性较高。
java
SQL92和SQL99都是用来表示多表的联合查询使用的,二者在开发中,具体使用哪种都是能够的,可是在书写和阅读的过程当中,具体表如今如下:sql
一、笛卡尔积中的区别spa
①SQL92中的笛卡尔积:select * from emp,dept ②SQL99中的笛卡尔积:select * from emp cross join dept
二、等值链接方面的区别.net
①SQL92表示:select * from emp,dept where emp.deptno=dept.deptno ②SQL99表示:select * from emp innner join dept on emp.deptno=dept.deptno
三、不等值链接方面code
```java ①SQL92表示:select * from emp ,salgrade where emp.sal<=salgrade.hisal and emp.sal>=salgrade.losal ②SQL99表示:select * from emp inner join dept on emp.deptno=dept.deptno where sal>2000
四、左外链接blog
①SQL表示:select * from emp ,dept where emp.deptno=dept.depetno(+) ②SQL99表示:select * from emp left outer join dept on emp.deptno=dept.deptno
五、右外链接ci
①SQL92实现:select * from emp ,depet where emp.deptno = dept.deptno; ②SQL99实现:select * from emp righ outer join dept on emp.deptno=dept.deptno
六、全完链接开发
①SQL92实现:select * from emp,dept where epm.deptno(+) = dept.dpetno(+) ②SQL99实现:select * from emp full outer join dept on emp.deptno=dept.deptno;
七、自链接it
①SQL92实现:select e1.*,e2.ename from emp e1,emp e2 where e1.deptno=e2.deptno ②SQL99实现:select e1.*,e2.ename from emp e1 inner join emp e2 on e1.deptno=e2.deptno
八、在三表链接查询中class
①SQL92实现:
select e.*,d.dname,c.cname from emp e,dept d,city c where (e.deptno=d.deptno and d.loc=c.cid and sal>2000) or (e.deptno=d.deptno and d.loc=c.cid and comm is not null) order by e.sal ②SQL99实现: select * from emp e inner join dept d on e.deptno = d.deptno inner join city c on d.loc =c.cid where e.sal>2000 or e.comm is not null order by e.sal
此外,SQL99中在内链接中还可使用关键字:using
select * from emp inner join dept using(deptno)
部分转载自:
https://blog.csdn.net/wyqwilliam/article/details/103076797?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1.control