Forum: Rails-ES hacer consulta con Group

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
51bb5688c8c2c1b68d03c56da8e0b696?d=identicon&s=25 Alfredo Gama (alfredogz)
on 2007-01-16 19:03
Holas

quiero hacer esta seleccion:
SELECT A,MAX(MY_DATE) GROUP BY A

en RoR como seria??

gracias
8c01355770b98df67a28e5306c5b6502?d=identicon&s=25 Jaime Mora Ramones (moctan)
on 2007-01-17 02:18
values = MyModel.maximum(:my_date, :group => :a)


Espero te sirva
---
Jaime Mora Ramones
51bb5688c8c2c1b68d03c56da8e0b696?d=identicon&s=25 Alfredo Gama (alfredogz)
on 2007-01-17 13:51
Jaime Mora Ramones wrote:
>
> values = MyModel.maximum(:my_date, :group => :a)
>
>
> Espero te sirva
> ---
> Jaime Mora Ramones

Para que version es esta funcion??

gracias
8c01355770b98df67a28e5306c5b6502?d=identicon&s=25 Jaime Mora Ramones (moctan)
on 2007-01-17 16:17
Actualmente tengo la versión 1.1.6, hice la prueba y funcionó
correctamente.

Espero te sirva
---
Jaime Mora Ramones
This topic is locked and can not be replied to.