我有以下的数据库strucutureSQL查询与结表合并行
1表名为Books(BOOKID,标题) 1表署名作者(的AuthorID,AUTHORNAME) 1接线表命名BooksAuthors(的BookID,属于AuthorID )与关系到其他2个表
我使用这个查询:
Select
Books.BookId,
Books.Title,
Authors.AuthorName
From
(Books Inner Join
BooksAuthors On BooksAuthors.BookId = Books.BooksId) Inner Join
Authors On BooksAuthors.AuthorId = Authors.AuthorId
我得到的是这样的:
BookId Title AuthorName
001 Title1 Name1
001 Title1 Name2
001 Title1 Name3
002 Title2 Name5
002 Title2 Name6
我奇怪的是有可能做到的查询将返回是这样的:
BookId Title AuthorName
001 Title1 Name1;Name2;Name3
002 Title2 Name5;Name6
您使用的数据库是? – rtcherry
该数据库是在ms访问 – user2422053