BigQuery is not running my JOIN IN code, returning error `Unrecognized name: employees at [10:3]`

34 views Asked by At

I am following the Google data analytics course and following the course guide.

I get the error

Unrecognized name: employees at [10:3]

My code:

SELECT 
    employees.name AS employee_name,
    employees_role AS employee_role,
    departments.name AS department_name,
FROM `western-will-410400.Employee_data`
INNER JOIN Employee_data.Departments
ON employees.department_id = deparments.department.id 
1

There are 1 answers

0
nbk On

You can not shorten the table names this way you need to alias them

SELECT 
  employees.name AS employee_name,
  employees_role AS employee_role,
  departments.name AS department_name,

 FROM `western-will-410400.Employee_data` as employees
 
 INNER JOIN
  Employee_data.Departments as deparments ON 
  employees.department_id = deparments.department.id