Regards,
I have a model where I need to pull 15 random rows,
but this didn't work:
->orderBy(NULL, 'RAND()') // params are only $column and $direction
But I found the solution/hack with this:
->appendRawWhere(null, 'ORDER BY RAND()')
Is there some other way to add custom sql?
Regards, I have a model where I need to pull 15 random rows, but this didn't work:
->orderBy(NULL, 'RAND()') // params are only $column and $direction
But I found the solution/hack with this:->appendRawWhere(null, 'ORDER BY RAND()')
Is there some other way to add custom sql?