title: How to limit values when using distinct
body: <p>PHP</p>
  
  <pre><code>  SELECT DISTINCT bk.title AS Title, bk.year AS Year, aut.authorname AS Author, cat.category AS Category
           FROM book bk 
  
           JOIN book_category bk_cat 
           ON bk_cat.book_id = bk.bookid
  
           JOIN categories cat 
           ON cat.id = bk_cat.category_id
  
           JOIN books_authors bk_aut 
           ON bk_aut.book_id = bk.bookid
  
           JOIN authors aut
           ON aut.id = bk_aut.author_id
  
           ORDER BY bk.title ASC
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/CAjqV.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/mwEBY.png" alt="enter image description here"></p>
  
  <p>My data base is echoing out the following data you can see that it prints the book out more than once if it has more than one category. from my php code can anyone tell me how i can make it distinct from the category column. Thanks.</p>