In MySQL, I have an old table entities
where the gender
column is formatted as ENUM , containing values of type "i", "m", "f".
When migrating this data to the new structure of this table, I wanted to run a query on the database collecting the values as they will be in the target table:
Example:
┌─────────────┬────────────────────┐
│ Valor atual │ Valor pretendido │
├─────────────┼────────────────────┤
│ i │ undifferentiated │
├─────────────┼────────────────────┤
│ m │ male │
├─────────────┼────────────────────┤
│ f │ female │
└─────────────┴────────────────────┘
How can I apply a IF ELSE
condition in the selection of this column, indicating the desired value for each of the existing options?