Magento join select multiple columns


Magento join select multiple columns : You can select multiple columns as below.


Example of magento join select multiple columns

You can select multiple columns in magento joins as below:

//load collection 
$collection = Mage::getModel('module/model_name')->getCollection();
$collection->getSelect()->join('table2'=>'table2_to_be_joined','main_table.table_field ='table2.table2_field',array('table2.field_name1','table2.field_name2','main_table.field_name1','main_table.field_name2','main_table.field_name3'));

You can use table alias to select columns as above.


Advertisements

Add Comment

📖 Read More