Skip to content

Instantly share code, notes, and snippets.

@suissa
Created October 31, 2012 14:42
Show Gist options
  • Save suissa/3987413 to your computer and use it in GitHub Desktop.
Save suissa/3987413 to your computer and use it in GitHub Desktop.
SUM in CakePHP
$this->ContaCorrente->find('first',
array('fields' =>
array('SUM(ContaCorrente.valor) AS total'),
'conditions'=>array('ContaCorrente.moeda' => 'REAIS')
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment