table book:
BookCode| AuthorShortN |Title
============================================
101 | Anton B | THe Book of Leaves
102 | JJ. Abram | Wish Upon A Star
103 | Anonymous | Secret of Universe
104 | Anton B | The Sentinel
table author:
AuthorID|AuthorFullName |Nationality
=====================================
A01 | Anton Balwin | USA
J02 | Johannes J Abram| UK
table bookauthor:
BookCode|AuthorID
=================
101 | A01
102 | J02
103 | X01
104 | A01
我有三个结构看起来像这样的表。我想要一个查询,结果是:
如果我做这个查询
select *
from book tb , author ta, bookauthor tba
where tb.BookCode = tba.BookCode and tba.AuthorID = ta.AuthorID
它不会显示row 103 | Anonymous | Secret of Universe
,因为作者不在表作者中。
我想要的是:
BookCode| Title | AuthorID | AuthorShortN
===========================================================
101 | THe Book of Leaves|A01 | Anton Balwin
102 | Wish Upon A Star |J02 | Johannes J Abram
103 | Secret of Universe|NULL | Anonymous
104 | The Sentinel |A01 | Anton Balwin
如何修复查询以产生这样的结果?
非常感谢您的帮助。