Jump to content
MakeWebGames

Joining three tables to one query


Recommended Posts

I'm a bit confused on what type of JOIN to use for this.

I have three tables, all containing the column USERID. I want to join them all together into one query so that i can place them into an array.

Right so i want the row from the tables as long as the userid is the same between them all.

Do i use inner join, left join, right join, full join? (what even is the difference) and how would i arrange it in a query?

thanks for any help

Link to comment
Share on other sites

You missed out natural join ^_^.

I would use inner join, if one of the tables doesn't contain data it won't return anything, left and right join simply adds the data to left or right side of the main table.

I believe that's how it works,

Link to comment
Share on other sites

Still can't really get my head wrapped around the "matches" part of it. does it only take the row from the other table which has the same column name and value as all the column names in the first table? Or does it give you the full row if as long as one column matches a certain column in the other table?

inner join didnt work, left join did work :S

Edited by !Angel
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...