[Dbix-class] Searching N rows sorting randomly

Pedro Melo melo at simplicidade.org
Sat Nov 28 21:30:04 GMT 2009


Hi,

On 2009/11/28, at 20:25, Alberto Simões wrote:

> On Sat, Nov 28, 2009 at 6:18 PM, Pedro Melo <melo at simplicidade.org>  
> wrote:
>>>
>>>           my @words = $schema->resultset('Word')->search(undef,
>>>                                                          {rows =>  
>>> $LIMIT,
>>>                                                           order_by  
>>> =>
>>> ...????
>>>                                                           columns =>
>>> ['word']});
>>
>> Untested but try order_by => \'RANDOM()'
>>
>> In other places, when you need to put direct SQL, you use a scalar  
>> ref.
>
> You're my Bitch :) Thanks :D

I helped you :), shouldn't that be the other way around?? :)

Bye,


More information about the DBIx-Class mailing list