Home Databases Sql What's the difference between RIGHT, LEFT, OUTER, INNER, JOIN?
 
 
 

What's the difference between RIGHT, LEFT, OUTER, INNER, JOIN?

PDF Print E-mail

Question: What's the difference between RIGHT, LEFT, OUTER, INNER, JOIN?

Answer: The difference is the way the tables are joined if no common records are available.

RIGHT - RIGHT JOIN is the opposite of LEFT JOIN and the same as RIGHT OUTER JOIN. Shows all records from the right table and only matching records from the left table.

LEFT - LEFT JOIN shows all records from the left table does not matter if matching records in the right table exists or not. Also the same as LEFT OUTER JOIN.

JOIN - JOIN is the same as INNER JOIN. JOIN means to only show records common to both tables. Will only show records if the same ID value exists in all tables used. If we have a product's table and a categories table, both have columns with name product_id. If the product_id in the product's table does not match the product_id in the categories table. No results will show.

+/-
+/- Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
Security Please input the anti-spam code that you can read in the image.
 
 
Banner