[TYPO3-mvc] ORDER BY RAND()

Susanne Moog typo3 at susannemoog.de
Mon Mar 15 07:14:18 CET 2010


Hey Jochen,

Am 14.03.2010 23:05, schrieb Jochen Rau:
> Hi Susanne.
> 
> On 14.03.10 13:44, Susanne Moog wrote:
>> can I use extbase setOrderings to get an "ORDER BY RAND()" in the mysql
>> query? As far as I have seen, this is currently not possible. Is it
>> planned?
> 
> No.
> Yes.
> No.
> 
> ;-)
> 
> You might want to use shuffle($array) instead.

that's what I'm currently doing, but it's not nice, as I have to fetch
all items first, then shuffle and then splice to get 10 random elements.
Performance wise at least it would certainly be faster with ORDER BY
RAND() LIMIT 0,10. What speaks against implementing it?

Best regards,

Susanne


More information about the TYPO3-project-typo3v4mvc mailing list