I have a table in which 1 and 0 appear in a column, I would like to perform a query in which if it is 1 I want it to appear male and if it is 0 female.
the result would be a column called gender in which instead of 1 and 0 it would read feminine or masculine.
I also ask because I don't know if this can really be done, thanks in advance.
Edit I have tried the following:
SELECT id_customer as id_Cliente, firstname as Nombre, lastname as Apellidos ,id_gender as Genero, company as Empresa
CASE
WHEN id_gender = 1 THEN "Masculino"
WHEN id_gender = 2 THEN "Femenino"
ELSE "No ha elegido genero"
END
FROM ps_customer
But I think it is not correct since I do not see any result.
For this you must use CASE in this link you can find more information.