title: SQL Select Unique Values (Book and Authors)
body: <p>This is my code:</p>
  
  <pre><code>SELECT b.nameBook, a.firstName, a.lastName FROM books b 
     INNER JOIN books_author ba ON b.idBook = ba.BooksId 
     INNER JOIN author a ON a.idAuthor = ba.AuthorId 
     ORDER BY b.nameBook;
  </code></pre>
  
  <p><a href="https://i.gyazo.com/fb011b9d8af88a1250e9f0ee87d8342e.png" rel="nofollow noreferrer">Result</a></p>
  
  <p>I don't want to repeat the books name (in this case, "Fisica 11"). I want it <a href="https://i.gyazo.com/403990e13327fb2511be605a8157822d.png" rel="nofollow noreferrer">like this</a>. How can I do it? Sorry if this is a dumb question, i'm a beginner.</p>
  
  <p>Also, I wanted to ask if there is any difference between the code above and the one below and which one is better to use:</p>
  
  <pre><code>SELECT nameBook, lastName, firstName 
      FROM books b, author a, books_author ba 
      WHERE ba.AuthorId = a.idAuthor 
          AND ba.BooksId = b.idBook
  </code></pre>
  
  <p>Both of them give the same result.</p>
  
  <p>I tried GROUP BY but <a href="https://i.gyazo.com/d03f83dd17d9e416880a2796802ebf7a.png" rel="nofollow noreferrer">this</a> is what happens.</p>
  
  <p>I could easily fix this by using php but I want to use SQL. Thank you.</p>