I am trying to join two tables where I need to show only 3 columns from the second, where another column is used as a comparison.
For instance:
The first table is called employee: it has a user_id column and some other columns
The second table is called people: it has a column user_id, which includes some of the users user_ids
The columns that I want to select are all from the people in the table! (first name, last name, email address)
I tried the following, but something is wrong:
SELECT userid, firstname, lastname, email FROM people JOIN employee WHERE people.userid = employee.userid;
I'm not sure what I'm doing wrong, could you help me fix this?
source share