title: How do you display a Magento sql query as a string?
body: <p>Magento constructs its SQL queries like</p>
  
  <pre><code> $this-&gt;getSelect()-&gt;joinInner(
          array('sbao' =&gt; $this-&gt;getTable('sales/billing_agreement_order')),
          'main_table.entity_id = sbao.order_id',
          array()
      )
  </code></pre>
  
  <p>Is there a way to display the resulting query in a string format rather than printing out the huge object e.g.</p>
  
  <pre><code>echo $this-&gt;getSelect()-&gt;joinInner(
          array('sbao' =&gt; $this-&gt;getTable('sales/billing_agreement_order')),
          'main_table.entity_id = sbao.order_id',
          array()
      )-&gt;toString();
  </code></pre>