satishgadhave Posted April 21, 2009 Share Posted April 21, 2009 I have a table named as 'books' and it contains book details including title and ISBN number for each book. Some books have same name and ISBN number but other books have same name but different ISBN. Requirement is when I display book listing on website, books with same name should not appear except they have different ISBN numbers. If I used 'group by title' then only one of the books with different ISBN numbers and same name appears where all of such books should appear. Any help will be appreciated. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/155039-solved-group-by-clause/ Share on other sites More sharing options...
rhodesa Posted April 21, 2009 Share Posted April 21, 2009 well, first, you should do everything in your power not to have duplicates in your book table. so each row represents a unique book but, if you have duplicates, group by title and isbn: GROUP BY isbn, title Quote Link to comment https://forums.phpfreaks.com/topic/155039-solved-group-by-clause/#findComment-815429 Share on other sites More sharing options...
satishgadhave Posted April 21, 2009 Author Share Posted April 21, 2009 Hi rhodesa, Thanks a lot for your help. It worked perfectly. Quote Link to comment https://forums.phpfreaks.com/topic/155039-solved-group-by-clause/#findComment-815478 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.