On 18 January 2011 15:14, James Byrne <li...@ruby-forum.com> wrote:
> Tim Shaffer wrote in post #975719:
>> Queries don't really work that way. You can't really select the full
>> record when using distinct client_category.
>>
>> Lets say you have the following rows:
>>
>> client_category, client_name
>> Cat1, Foo
>> Cat1, Bar
>> Cat2, Other
>>
>> If you are selecting distinct client_category, and want the full row,
>> which
>> of the two "Cat1" rows should it return?
>
> What I want to accomplish is to obtain one example of each value and the
> entire row that contains it.  How does one do that?  I do not care which
> row is returned but I only want one row for each distinct value.

Why?  If you do not care which row is returned then presumably you do
not care what is in the rest of the row so why do you need it?

Colin

-- 
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to