0

I have a database

  • books
    • id
    • title
    • summary
    • year
  • genres
    • id
    • name
  • author
    • id
    • name
  • books_genres
    • id_book
    • id_genre
  • books_author
    • id_book
    • id_author

i need request that can present 2 or more genres or author in one stroke

Title: lol Summary: lorem Genres: Novell, BDSM Authors: Uncle John, Aunt Dad.

i wrote something like this, but it show two dublicated strokes with different genres

SELECT 
    books.title, genres.name 
FROM 
    books, books_genres, genres 
WHERE books.id = books_genres.id_book AND genres.id = books_genres.id_genre
Shadow
  • 33,525
  • 10
  • 51
  • 64

0 Answers0