It is better to implement new method in class of rad_inventorypieces/piece_collectionpiece
resource model
Method might look like this:
/**
* @return string
*/
public function getSumD()
{
$select = $this->getReadConnection()
->select()
->from($this->getMainTable(), array('sum' => new Zend_Db_Expr('SUM(d)')));
return $this->getReadConnection()->fetchOne($select)
}