(SELECT schemename, message FROM RandomMessagesSet where type = 'ES' ORDER BY RAND())
UNION ALL (SELECT schemename, message FROM RandomMessagesSet where type = 'HE' ORDER BY RAND()) ORDER BY schemename;
This gives the list of all the messages with their scheme names. Is there a way to get 3 each of type "ES" and 2 each of type "HE" for each of schemename?
This is not a homework but part of a research problem that would feed into designing a user study. I tried using LIMIT and JOIN by looking at most of the posts here but still stuck.
Please help me. Your help would assist me to design my second last experiment for my PhD.
EDIT: Thanks to the most empathetic person who downvoted this. You should try doing a PhD yourself to get the feel of it.
I'm afraid I cannot provide sample data due to nature of research work.
Desired output: