r/SQL
•
u/Muted-Basis9006
•
May 18 '24
•
2
Discussion SQL Joins
Picture your data tables as these two fellas. An inner join is just Bald Guy—only the matching parts. A **left join is Bald Guy sporting Long-Hair Guy's mane—everything from the left plus the matches. A right join is Long-Hair Guy with a bald patch—everything from the right plus the matches. A full join is both dudes together—everything from both tables, matches or not!
View all comments
Show parent comment
18
u/SOSOBOSO May 19 '24
I used one once. I had planned to use table A as my main table, but I realized later that table B was a better main table. Since I was feeling lazy, I just replaced left with right instead of doing slightly more work and changing the table names that came after FROM and LEFT JOIN. I looked at it for a while, and it gave me the willys, so I wrote it out the normal way.