I'm coding a Phonegap based app for iOS, and am trying to return 10 random rows from my Safari webkit database via Javascript. My query is:
queryString = "SELECT * FROM SBA_TABLE
WHERE (cat_gastrointestinal = 1)
AND (answered_correctly = 0 OR answered_correctly = 1 OR answered_correctly = 2)
ORDER BY RANDOM() LIMIT 10";
tx.executeSql(queryString, [], querySuccess5, errorCB);
This works if I omit the 'ORDER BY RANDOM()' statement which leads me to believe this is not supported. Is there a RANDOM method I could use, or do I have to generate 10 random numbers and make 10 database calls?! Thanks, Nick