I want to create a query like this
SELECT id, name, type, image FROM table ORDER BY type ASC, image.....
Pick up all type A rows first randomly, then list all type B rows randomly and all type C rows randomly. Within a same type, check if the row has image or not, then list rows with image randomly above rows without image.
The table has several thousand rows.
Any one has a good solution? Appreciate your help. Thanks