For example if you had a table books and you wanted to find all books by a certain name, then get the author of those books and research the books table for all entries in the table. For instance if you searched the title “All About Pirates” and then there were 2 books with the title, one by “Jane Doe” and another by “Joe Smith” then the table would be searched again for all titles by those authors.
select *
from books b
join books b2 on b.author = b2.author
where title = 'All About Pirates'
Use a sub query like this:
SELECT * FROM books WHERE author IN (SELECT author FROM books WHERE title=’All About Pirates’);