1
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 returns to me the last man and the last woman who registered.
Does anyone know how I could unify these darlings? It’s because this is just an example, in my system I’m going to need to do seven of these, so if this was to unify it would be better.
I am using the Laravel, if it is possible to do this using the Eloquent would be even better.