TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Joins In Steps

75 点作者 zindlerb大约 6 年前

4 条评论

p2t2p大约 6 年前
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 未加载
rtpg大约 6 年前
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_latte大约 6 年前
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 未加载
revskill大约 6 年前
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 未加载