I have the following piece of code which i taken from model,
... $select = $this->_db->select() ->from($th
You can use Zend_Debug::Dump($select->assemble()); to get the SQL query.
Zend_Debug::Dump($select->assemble());
Or you can enable Zend DB FirePHP profiler which will get you all queries in a neat format in Firebug (even UPDATE statements).
EDIT: Profiling with FirePHP also works also in FF6.0+ (not only in FF3.0 as suggested in link)