---
title: "How to remove unnecessary columns in Magento collection"
author: "cgzhang"
date: "2011-01-19T12:56:44Z"
tags: ["PHP"]
categories: ["编程语言"]
slug: "how-to-remove-unnecessary-columns-in-magento-collection"
draft: false
lastmod: "2011-01-19T12:56:44Z"
id: 888586
url: "https://magentosh.iteye.com/blog/888586"
---

```php

$orders = Mage::getModel('sales/order')->getCollection();
		
		$orders->getSelect()->reset('columns');
		
		$orders->getSelect()->columns(array('total_amount'=>'sum(grand_total)'));

```