So I'm totally having a hard time on comprehending SQL this semester. I'm really not confident on the knowledge I have in SQL and I'm trying to work on this exercise where it says:
A SELECT statement to retrieve a list of employees with the columns DEPARTMENT_ID , DEPARTMENT_NAME , FULL_NAME, JOB_TITLE
where FULL_NAME is the First name and Last name concatenated with a space between them for those employees that their Job title contains the word 'Sales'. The list must be sorted by job title and department name.
So far, I came up with this
SELECT department_id,
department_name,
first_name || ' ' || last_name as Full_name,
job_title
FROM departments d, employees e, jobs j
WHERE d.department_id=e.department_id
HAVING job_title LIKE '%Sales%';
and the error says:
Error starting at line 1 in command:
select department_id, department_name, first_name || ' ' || last_name as Full_name, job_title
from departments d, employees e, jobs j
where d.department_id=e.department_id
having job_title like '%Sales%'
Error at Command Line:1 Column:8
Error report:
SQL Error: ORA-00918: column ambiguously defined
00918. 00000 - "column ambiguously defined"
*Cause:
*Action:
Any tips and help will do.