Magento collection add join and filter

$tableDataCollection = Mage::getResourceModel('modulename/tablename_collection')->setPageSize(50);
 
$tableDataCollection->getSelect()
            ->join(array('alias' => Mage::getSingleton('core/resource')->getTableName('modulename/tablename')),
                'main_table.id=alias.id', '*')
            ->where('alias.condition = ?', true);

Leave a Reply