ukscotth Posted August 22, 2011 Share Posted August 22, 2011 Hi, I have a database table which is full of books e.g book_title, book_author, book_date etc. Im trying to work out a way to list all the authors without duplicating them, if that makes sense. If I do a simple query and then display the book_author in a loop it will show multiple entries for each author. I just want it to display each author once. Hope that makes sense lol sorry Im a newbie. Anyone know how I can do it ? Thanks in advance, Scott. Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 22, 2011 Share Posted August 22, 2011 select distinct `author` from `table_name` order by `author` Quote Link to comment Share on other sites More sharing options...
ukscotth Posted August 22, 2011 Author Share Posted August 22, 2011 Thanks alot webstyles, il give it a try Quote Link to comment Share on other sites More sharing options...
ukscotth Posted August 22, 2011 Author Share Posted August 22, 2011 works perfect. Thanks again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.