[TYPO3-mvc] ORDER BY RAND()

Jochen Rau jochen.rau at typoplanet.de
Mon Mar 15 09:03:39 CET 2010


Hi Susanne.

On 15.03.10 07:14, Susanne Moog wrote:
> 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?

Nothing. But you didn't ask, if something speaks against implementing 
it. ;-)

Please open two feature requests (Extbase, FLOW3) referring to each other.

http://forge.typo3.org/projects/typo3v4-mvc/issues
http://forge.typo3.org/projects/package-flow3/issues

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list