TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Joins In Steps

75 pointsby zindlerbabout 6 years ago

4 comments

p2t2pabout 6 years ago
I think about my self as quite SQL-savvy person, I used to optimize quite complex queries and is able to read plans for Oracle, Postgres and MySQL.<p>And yet, I&#x27;ve got not idea why would anybody need right join.<p>Have you guys ever had a case when you&#x27;d need a right join? I&#x27;ve been to the field for 15 years and yet to see people using right join in the wild.<p>Like the last example in this link - why would you do that? Most probably your business logic focuses on dogs, something like &quot;find dogs with no owner&quot; or something, In this case it is much more readable and straight forward to go with left join or even with sub-select where you&#x27;d have something like &#x27;select * from dogs where owner_id not in (select id from owners)&#x27;.<p>Have you used right joins and if you have can you explain the use case?
评论 #19884934 未加载
评论 #19886872 未加载
评论 #19886085 未加载
评论 #19885306 未加载
评论 #19886304 未加载
评论 #19886221 未加载
评论 #19886345 未加载
rtpgabout 6 years ago
I really feel like we need a lower level expression language than SQL, one based on actual query plans rather than a declarative thing.<p>Having that, and helping people learn that, would make it much harder to not “get” how joins and the like end up working
评论 #19886243 未加载
评论 #19886114 未加载
评论 #19885479 未加载
obituary_latteabout 6 years ago
That’s a typo in the last paragraph, no?<p>&gt;The left right is the table named in the outer join part of the query.
评论 #19889608 未加载
revskillabout 6 years ago
Does SQL Join allow equality with operators like ilike, like,... or custom equality function ?<p>select * from a inner join b on mycustomfunction(a, b);
评论 #19884688 未加载