Created
January 2, 2013 03:32
-
-
Save dsueiro/4431909 to your computer and use it in GitHub Desktop.
Using group_concat in cakephp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var_dump($this->Resolucion->find('all', | |
array('joins' => array( | |
array( | |
'table' => 'resoluciones_palabras_clave', | |
'type' => 'LEFT', | |
'conditions' => array('Resolucion.id = resoluciones_palabras_clave.resolucion_id') | |
), | |
), | |
'limit' => 5, | |
'group' => 'Resolucion.id', | |
'fields' => 'Resolucion.id, group_concat(resoluciones_palabras_clave.palabra) as palabra',))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment