Need to count number of occurrances of records in a table
685184Feb 15 2009 — edited Feb 15 2009I have been tasked with returning data that will count the number of times each record in a particular column exists in the database and return that information to a report for every item that is greater than one. The database is a sample database from a book store. The list I am attempting to create is a list of ISBN numbers that has more than one author. I don't want to return the ISBN number, just the number of authors the book has, which can be garnered by counting the occurances of like ISBN numbers in the table. Any help on this would be appreciated. I have come up with:
select distinct title, (select count(bookauthor.isbn) from bookauthor)
from books, bookauthor
group by title, bookauthor.isbn;
so far, but this returns all the titles and the number 20 for the count statement, which is the total number of ISBN numbers listed in the table.
Thank you