this is my mysql query . I want to convert in magento collection.
reference link https://stackoverflow.com/questions/34253461/repeat-a-result-row-multiple-times-by-value-in-row
select Item , ItemName , Quantity
from yourtable A
cross join (select num from numbers) b
where a.Quantity <= b.num
I tried below code but not work
$collection = Mage::getModel('sales/order_item')->getCollection()->addFieldToSelect(array('sku','qty_ordered'));
$collection->getSelect()->joinCross(array('num' => 'new_table_qty_numbers'),array('main_table.sku','main_table.qty_ordered'))
->where('main_table.qty_ordered >= num.qty'); //also tried main_table.qty_ordered <= num.qty
echo "<pre>";
print_r($collection->getData());