Re:SQL language proposal: JOIN FOREIGN
by zeroimpl on Thursday December 30, 2021 @04:44PM
(#29741805)
Yeah I think something like this is the way to go. The table name needs to be listed in a consistent manner like all other joins, and I don't think the syntax should be different depending on which order the tables are listed in.
With the above proposal, it seems the foreign key name could be left out in the common case of there being only one fkey between the two tables too.
Re:SQL language proposal: JOIN FOREIGN
by magicalhippo on Thursday December 30, 2021 @05:07PM
(#29742073)
> With the above proposal, it seems the foreign key name could be left out in the common case of there being only one fkey between the two tables too.
Yes, this was indeed my intention. The common case with only a single matching foreign key constraint would not require being explicit, but one could be if needed in a natural way.
JOIN films f USING FOREIGN KEY films_did_fkey
[1]: https://news.ycombinator.com/item?id=29687565