Or without the added calories (syntactic sugar) : select a.*, b.* from author_books ab, author a, books b where a.author_id = ab.author_id and b.book_isbn = ab.book_isbn
On Tue, 27 Aug 2019 at 15:52, David Raymond <david.raym...@tomtom.com> wrote: > It does support natural joins. <Insert usual "be careful with schema > changes" comments here> > > USING needs parenthesis around the column list: ...using > (author_id)...using (book_isbn)... > > > -----Original Message----- > From: sqlite-users <sqlite-users-boun...@mailinglists.sqlite.org> On > Behalf Of Dominique Devienne > Sent: Tuesday, August 27, 2019 10:08 AM > To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> > Subject: Re: [sqlite] Query for Many to Many > > On Tue, Aug 27, 2019 at 4:00 PM Dominique Devienne <ddevie...@gmail.com> > wrote: > > > select author.*, books.* > > from author_books > > join author on author.author_id = author_books.author_id > > join books on books.book_isbn = author_books.book_isbn > > > > Which can also be written: > > select author.*, books.* > from author_books > join author using author_id > join books using book_isbn > > Or even: > > select author.*, books.* > from author_books > natural join author > natural join books > > All of the above untested of course :). > Not even sure SQLite supports natural join or not (I'd guess it does). --DD > > https://stackoverflow.com/questions/45531762/sql-join-using-vs-join-on > > https://stackoverflow.com/questions/8696383/difference-between-natural-join-and-inner-join > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users