Hello!
A slightly unusual MySQL request is required.
The bottom line is:
We have a table, say, 'table', it has fields: 'id', 'name', 'tag', 'status'.
Task: make a sample of the same 'name' (i.e., let's say if we have name in the database: 'Ivan', 'Alexander', 'Alexander', 'Ivan', then we need the database to be issued either by Ivan Ivan, or Alexander Alexander), you also need to make a condition so that the 'status' field is equal to '1'.
My work:
SELECT * FROM (`table`) WHERE `name` IN (SELECT `name` FROM `table` GROUP BY `name` HAVING count(*)>1) AND `status` = '1'
But at this request, it gives out both Ivan and Alexander, and I also need to give out only one value.