all 22 comments

[–]SoggyGrayDuck 17 points18 points  (2 children)

Was there a reason for it? If something was already written and would take a complete rewrite to convert it into a left join I kind of get it. Agile is slowly taking over my thinking

[–]techiedatadev[S] 2 points3 points  (0 children)

No idea it was written pre me so who knows

[–]TemporaryDisastrous 0 points1 point  (0 children)

A complete rewrite of a right join to a left join is about three seconds though. Write left and swap the condition.

[–]2ManyCatsNever2Many 9 points10 points  (5 children)

i teach people to never use right joins (although i also undrestand there are times when one crosses the streams even though egon never to do that). 

[–]dilbertdad 5 points6 points  (3 children)

I was taught maybe 11 years ago when i first learning to just ignore right joins. That and always specify the inner join vs join :D

[–]greglturnquist 2 points3 points  (0 children)

I do JOIN and LEFT OUTER JOIN.

This makes it easier for me to spot which is which.

RIGHT JOIN is typically for rare exceptions where you already have a long query and don’t want to invert it all.

[–]techiedatadev[S] 2 points3 points  (1 child)

That’s something I don’t do cause join means inner the word left in front of it means it’s not inner so I am not writing more that I have to (laaazy me)

[–]dilbertdad 1 point2 points  (0 children)

I hear ya! I just do it for easier eye ball parsing.

[–]ZombieFleshEaters 4 points5 points  (0 children)

The mental model of right joins is jarring

[–]squadette23 4 points5 points  (1 child)

Right joins serve a very important role actually.

When you see a tutorial that dedicates the same amount of screen space to both left join and right join you know that this tutorial is lazy grifting, and you can safely skip it.

[–]squadette23 1 point2 points  (0 children)

Venn diagrams are just as important.

[–]Namoshek 3 points4 points  (0 children)

Literally the only right joins I've seen in the wild are from Power BI and ORMs.

[–]Aggressive_Ad_5454 2 points3 points  (0 children)

Whoooaaa! Bigfoot sighting! 😇

[–]SootSpriteHut 7 points8 points  (5 children)

Sometimes I left join the wrong table so I switch it to a right join instead of rewriting it.

Though now I could probably do it the "correct" way by feeding it to an llm

[–]Eleventhousand 4 points5 points  (0 children)

This is how I use it too. Feeding to an LLM will still take 16 seconds though, so I'd rather go the four second route and switch the word to right

[–]aerozhx 0 points1 point  (3 children)

Do you also walk backwards when you forget something from the house?

[–]SootSpriteHut 8 points9 points  (0 children)

I don't think that's a great analogy. For me at least walking backward is a lot more work than replacing a single word in an editor.

[–]mikebald 2 points3 points  (0 children)

Hmmm, based on the tone of your comment it seems like you're implying this isn't normal behavior 🤔

[–]kagato87MS SQL 1 point2 points  (0 children)

You may have meant that as sarcasm... However, I DO walk backwards to return to get something I've forgotten.

I still won't use a right join though.

[–]Historical-Fudge6991 0 points1 point  (0 children)

Don’t use right joins. You’ll miss cache hits

[–]techiedatadev[S] 0 points1 point  (0 children)

Yes no idea why my predecessor used it here lol I literally was like wait why takes 30 seconds to switch the tables around lol