1

I have been facing issues while constructing a simple query to pull out 5 random albums from the device. All the audio files that are available on the device are stored in a table called song_table. The constructed query is as follows.

@Query("SELECT album_id, album_name, album_art, artist FROM song_table ORDER BY RAND() LIMIT 5")

enter image description here

The error points out that there is no function called RAND that exists. Assuming that most of the SQL queries are supported with Room, is this a query that still does not have support? Or is there an alternative way to achieve this?

Any help is much appreciated.

Sivan
  • 25
  • 2
  • 6

0 Answers0