You must create a stored procedure to which you pass as a parameter the sex and filter the data according to that:
DROP PROCEDURE IF EXISTS obtenerData //
CREATE PROCEDURE
obtenerData( parametro VARCHAR(20) )
BEGIN
IF(parametro = 'Indistinto') THEN
-- Devuelves toda la tabla si es 'Indistinto'
SELECT * FROM tabla
ELSE
-- Sino devuelves data de acuerdo al parámetro
SELECT * FROM tabla WHERE tabla.sexo = parametro
ENDIF
;
END
//
DELIMITER ;
Then you call that stored procedure according to your parameter
call obtenerData('Hombre');
call obtenerData('Mujer');
call obtenerData('Indistinto');