mysql - SQL command not properly ended trying to join three tables -


i trying sql statement, , stuck. this code trying do idea am trying join 3 tables employees,departments,locations questions **

  • whose employee have (2) 2 departments of same city?

** if possible please give me did wrong in code.

you should have 1 clause , suggest using joins. try this:

select e.firstname, e.salary+1000, d.department_name, e.department_id, l.city employees e inner join departments d on e.department_id = d.department_id inner join locations l on d.location_id = l.location_id 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -