samedi 16 juillet 2016

Auto fill other column in mysql table

I have column in mysql table like this:

| Column A | Column B |
| A        |          | 
| B        |          |
| C        |          |
| D        |          | 
| E        |          |

I want to auto fill the other column using rule if A,C,D then fill X and if B, E fill the Y in the column B field.

The result will be like this:

| Column A | Column B |
|----------|----------|
| A        | X        |
| B        | Y        |
| C        | X        |
| D        | X        | 
| E        | Y        |

Is there are an easy way to do that in MySQL query?

Thank you for help.

Aucun commentaire:

Enregistrer un commentaire