To get a generated SQL query in Magento we need to get collection object and using the collection we can get SQL Query by using bellow code.
/** Get SQL Qeury generated for Collection */
$this->_collection->getSelect()->__toString();
To get a generated SQL query in Magento we need to get collection object and using the collection we can get SQL Query by using bellow code.
/** Get SQL Qeury generated for Collection */
$this->_collection->getSelect()->__toString();