John Smith wrote:
> John Smith wrote:
>> John Smith wrote:
>>> I want to obtain a array group by a field_1 of a table but ordered by a
>>> field_2 of a table, with one line of code. How can I do that using
>>> Postgre? I'll appreciate any help
>> 
>> Also, one of the conditions of the SQL will user some pagination params 
>> from a plugin
> 
> Once again, already solved. Using subqueries.

Why?  I believe you should just be able to do
GROUP BY field_1
ORDER BY field_1, field_2

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to