Hacker News new | ask | show | jobs
by JoelJacobson 1631 days ago
Nice example! The join you describe would remain as a JOIN ON.

This is per design. Quote from the proposal:

"The idea is to improve the SQL language, specifically the join syntax, for the special but common case when joining on foreign key columns." ... "If the common simple joins (when joining on foreign key columns) would be written in a different syntax, the remaining joins would visually stand out and we could focus on making sure we understand them when reading a large SQL query."

So, the special non-equal based join condition you describe, would become more visible, and stand out, allowing readers to pay more attention to it.

The hypothesis is most joins are made on foreign key columns, so if we can improve such cases, a lot can be won.

2 comments

But how could you accurately tell if some queries join on the foreign key, but were written by someone without knowledge of the new specification?
Not sure I understand, can please elaborate? Perhaps with an example?
I see. I should have read the article more carefully :-)