This short piece of code returns the SQL query behind a Magento collection.

Getting the SQL query of a collection
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.
Tags: