Oracle SQL - Table Join Introduction

Introduction

You can specify multiple tables in the FROM component of a query.

The following code shows an error of ambiguously defined columns.

select deptno, location, ename, init
from   emp, departments;

select deptno, location, ename, init
           *
ERROR at line 1:
ORA-00918: column ambiguously defined

The message reveals that the Oracle DBMS cannot figure out which DEPTNO column we are referring to.

Both tables mentioned in the FROM clause have a DEPTNO column, and that's why we get an error message.