I have to perform a search of the first records with a certain value, let me exemplify.
SELECT * FROM users WHERE gender LIKE '%M%' ORDER BY id DESC LIMIT 1;
SELECT * FROM users WHERE gender LIKE '%F%' ORDER BY id DESC LIMIT 1;
This gives me the last man and the last woman to join.
Does anyone know how I could unify these queries? It's because this is just an example, in my system I will need to do some 7 of these, so if you could unify it would be better.
I'm using Laravel, if it is possible to do this using Eloquent would be even better.