SQL99连接查询:CROSS JOIN与NATURAL JOIN详解.pdf

SQL99连接查询:CROSS JOIN与NATURAL JOIN详解.pdf

1.crossjoin(交叉连接)

交叉连接会产生一个笛卡尔积

select*fromempcrossjoindept;

在笛卡尔积中,有很多数据是无意义的,所以需要消除,

可以通过where子句来消除

select*fromempcrossjoindeptwhere

emp.deptno=dept.deptno;

可以在查询时,给表格起别名

selecte.*,me,locfromempecrossjoindeptd

whe

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档