3 ms·
For SQLite I use 'natural join': select foo_id, quux.value from foo natural join bar natural join quux Unfortunately this doesn't actually use the f
by gwd 5y ago
For SQLite I use 'natural join':
select foo_id, quux.value
from foo natural join bar natural join quux
Unfortunately this doesn't actually use the foreign key relation; it matches on the same element name. So you have to have `foo.bar_id` and `bar.bar_id`, as well as `bar.quux_id` and `quux.quux_id`. But I find that actually makes queries more readable.
- euroderf 5y agoI find that the use of this technique, plus banning NULLs (handle them in application code), promotes user sanity. My 0,02€.