If we have so many tables in FROM clause its very hard to keep track of joining conditions in WHERE Clause. So here is the simple way to remember it.
If we have N tables in FROM Clause, we need at least N-1 jion conditions in WHERE Clause to avoid a Cartesian product.
SELECT E.EMPID,E.ENAME,D.DEPTNO,D.DNAME
FROM EMPP E, DEPT D
WHERE D.DEPTNO = E.DEPTNO
You can see two tables and 1 condition...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment