What is the difference between CROSS JOIN and FULL OUTER JOIN in SQL Server?
Are they the same, or not? Please explain. When would one use either of these?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A
CROSS JOINproduces a cartesian product between the two tables, returning all possible combinations of all rows. It has noONclause because you’re just joining everything to everything.A
FULL OUTER JOINis a combination of aLEFT OUTERandRIGHT OUTERjoin. It returns all rows in both tables that match the query’sWHEREclause, and in cases where theONcondition can’t be satisfied for those rows it putsNULLvalues in for the unpopulated fields.This wikipedia article explains the various types of joins with examples of output given a sample set of tables.