mysql - SQL Error in WHERE clause -


i have tables

department: id, name employee: id, departmentid, name, surname 

departmentid foreign key referencing department(id) query:

select * employee employee.departmentid = department.id; 

returns error "unknown column department.id in clause"

i can't place error. how fix this?

thanks

you need include department table

select *  employee  join department    on employee.departmentid = department.id; 

this uses explicit join syntax ansi standard. should refrain implicit joins.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -