Database Help

I have a database, to simplify let’s say there is a category Field and an Item field.
I want to select x number of Items randomly for a given Category.
Additionally I have a flag called Wildcard. When Wildcard is True I need x-1 random Items for the current Category and one random Item for any Category.

Easily done with .net, but no idea where to start with Wix !
Any ideas ?

Hi,
Check out this ticket about pulling random item from a collection, in order to select few items, use a for loop and remove the random item from the results (so it won’t be picked again).

Let me know if you need further help,
Or