Get a single record from a database filtered by category_id and then randomised id

Options
I have a list of prompts that are all categorised. I want to set up an API to GET a single record, randomly, from a specific category.

I can easily filter by category ID and fetch a list of all prompts, but I can't see how to only select one from within that category and randomise which is picked.

Any help much appreciated!

Table structure:[Screenshot 2022-01-21 at 14.05.42.png]
Thanks

Comments