I know there is a difference between INNER JOIN and FULL OUTER JOIN, I can see it, but, what is the difference between the two following: JOIN ... ON... and INNER JOIN...ON... and still yet JOIN...ON... vs FULL OUTER JOIN...ON...

Reason being is I think maybe just using JOIN is messing up a query I am working on that is posted on SO, link to question HERE.

So basically what is the syntactical difference between the actual set operations themselves?

Thank You,

  • 1
    "Cross posting" is posting the same question in different forums. Posting a link is ok and desirable. – choroba Jul 25 '13 at 12:04
  • Ok, I'll post a link to the question, my code is return many many duplicates and it's driving me nuts...I have'nt even had my morning coffee yet lol – MCP_infiltrator Jul 25 '13 at 12:16
  • 4
    @MCP_infiltrator take a look at probably the best explanation out there: codinghorror.com/blog/2007/10/… – mkk Jul 25 '13 at 12:35
  • If the real problem is that your code is returning too many duplicates, you may want to ask another question where this is the main point. And you may want to post your code. When I've helped people with duplicate problems in the past, it's usually due to wrong join conditions, or occasionally due to poor mapping between the SQL data model and the relational data model. – Walter Mitty Jul 30 '13 at 12:49
  • Hi @WalterMitty the question is posted in SO, I think my joins are the problem, but on another note I was also just curious, I'm only abour 6 months into writing SQL and self teaching, the link is in the question. – MCP_infiltrator Jul 30 '13 at 12:55

JOIN and INNER JOIN are the same, the inner keyword is optional as all joins are considered to be inner joins unless otherwise specified. The difference between JOIN and FULL OUTER JOIN is the same as the difference between INNER JOIN and FULL OUTER JOIN.

An INNER JOIN will only return matched rows if a row in table A matches many rows in table B the table A row will be repeated with each table B row and vice versa.

A FULL OUTER JOIN will return everything an inner join does and return all unmatched rows from each table.

| improve this answer | |
  • 7
    Thank you, I didn't know that JOIN and INNER JOIN were equivalent statements. – MCP_infiltrator Jul 25 '13 at 12:32
  • 9
    Best practice is to explicitly write INNER JOIN in order to avoid confusion. – Neil Jul 25 '13 at 13:02
  • 1
    giving an example code in these forums beats the best professor lectures at Havard. Can you give an example please. – webs Dec 21 '19 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.