title: Magento. Unknown column 'sales_flat_order_item.order_id'
body: <p>all. I'm trying to get all order items from database, where order status is not "canceled". Here is a piece of code:</p>
  
  <pre><code>$items = Mage::getModel('sales/order_item')-&gt;getCollection();
  $rents-&gt;getSelect()-&gt;join( array('sales_order'=&gt;Mage::getSingleton('core/resource')-&gt;getTableName('sales/order')), Mage::getSingleton('core/resource')-&gt;getTableName('sales/order_item') . '.order_id = sales_order.entity_id', array('sales_order.state'));
  $rents-&gt;addFilter('product_id', $productId);
  $rents-&gt;addFilter('state', array('neq' =&gt; 'canceled'));
  </code></pre>
  
  <p>Dut, when i'm trying to run this code, i get an error: "Column not found: 1054 Unknown column 'sales_flat_order_item.order_id' in 'on clause'" </p>