I knew we can use toString method to print out the SQL query of collection, How can I do for Magento 2
Its using same method – toString() as Magento to print out the SQL query of collection.
echo $collection->getSelect()->__toString();
I knew we can use toString method to print out the SQL query of collection, How can I do for Magento 2
Its using same method – toString() as Magento to print out the SQL query of collection.
echo $collection->getSelect()->__toString();