Question : get collection select qurey
Answered by : nasty-newt-furotq6gb11n
$collection->load();
// the following statements are equivalent
$collection->getSelect()->assemble();
$collection->getSelect()->__toString();
echo $collection->getSelect(); // will call magic method __toString() behind the scenes which in turn calls assemble()
Source : https://magento.stackexchange.com/questions/166536/how-to-print-collection-mysql-query-in-magento-2 | Last Update : Fri, 24 Sep 21