[Semediawiki-user] Random Sort

 [Semediawiki-user] Random Sort From: Steren - 2008-07-25 18:01:23 Attachments: RandomSort.diff Message as HTML ```hi, I wrote yesterday a small patch for SMW. It allows to sort query results randomly. Creative Commons needed this feature for its Casestudies project. Just write "|sort=random" in the {{#ask}} params. It's compatible with other sorting, which means you can sort ascending by one property and then sort randomly by an other property. example: {{#ask: [[test::+]][[check::+]] |? |? test |? check |sort = test, check |order = asc, rand |limit = 3 }} It uses the MySQL RAND() function [1], which may not be very efficient on a large number of row [2]. I hope this will be useful. Feel free to add this patch to the SMW development repository if you want. Steren [1] : http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand [2] : http://forums.mysql.com/read.php?24,163940,163940 ```

 [Semediawiki-user] Random Sort From: Steren - 2008-07-25 18:01:23 Attachments: RandomSort.diff Message as HTML ```hi, I wrote yesterday a small patch for SMW. It allows to sort query results randomly. Creative Commons needed this feature for its Casestudies project. Just write "|sort=random" in the {{#ask}} params. It's compatible with other sorting, which means you can sort ascending by one property and then sort randomly by an other property. example: {{#ask: [[test::+]][[check::+]] |? |? test |? check |sort = test, check |order = asc, rand |limit = 3 }} It uses the MySQL RAND() function [1], which may not be very efficient on a large number of row [2]. I hope this will be useful. Feel free to add this patch to the SMW development repository if you want. Steren [1] : http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand [2] : http://forums.mysql.com/read.php?24,163940,163940 ```

JavaScript is required for this form.

No, thanks