Monday, January 26, 2009

Column Ambiguously Defined

INPUT:
SQL> @employee_tbl

OUTPUT:
SQL> spool employee.lst
SQL> set echo on
SQL> set feedback on
SQL> select p.ssn, name, e.address, e.phone
2 from employee_tbl e,
3 payroll_tbl p
4 where e.ssn =p.ssn;
select p.ssn, name, e.address, e.phone
*
ERROR at line 1:
ORA-00918: column ambigously defined
SQL> spool off
SQL>

ANALYSIS:
On line 1 the column name has not been defined. The tables have been given aliases of e
and p. Decide which table to pull the name from and define it with the table alias.

No comments: