Guest_imported
New member
- Jan 1, 1970
- 0
I have 2 tables and I'm having trouble joining them properly.
I have a table called BookTitles:
id title
-- -----
1 TitleA
2 TitleB
3 TitleC
I have a table of authors
id booktitle_id AuthorName
-- ------------ ----------
1 2 NameA
2 1 NameB
3 2 NameC
4 3 NameD
As you can see, some books have multiple authors (i.e. BookTitle.id = 2)
How can I select from these tables and end up with 2 columns -- one for booktitle and one for authors? If there are 2 authors for a book, I want them to appear in the same field (comma delimited?) in my result set.
Is this possible? Any help would be appreciated...
-erlyhal
I have a table called BookTitles:
id title
-- -----
1 TitleA
2 TitleB
3 TitleC
I have a table of authors
id booktitle_id AuthorName
-- ------------ ----------
1 2 NameA
2 1 NameB
3 2 NameC
4 3 NameD
As you can see, some books have multiple authors (i.e. BookTitle.id = 2)
How can I select from these tables and end up with 2 columns -- one for booktitle and one for authors? If there are 2 authors for a book, I want them to appear in the same field (comma delimited?) in my result set.
Is this possible? Any help would be appreciated...
-erlyhal