I have a library of books in an SQL database. Some of these books contain phrases from the original books -- theses books are called compilations (compiled from the original source). When I do a "like" search in SQL, I am returned many duplicate results due to the compilations. I cannot get rid of, hide, or flag the compilations in the database because this may remove some valid source material that is being searched for.
How would I group these results so that I am returned unique phrases that contain the searched for text rather than the same phrases from multiple compilations? What is the best way to accomplish this? The "Group By" statement wont work, some similar records are slightly different due to an ending reference at the end.
Right now the data is in an SQLlite database I am assuming I can import into MSSQL or MySQL