sql - Update statement to move wrong values to correct column -
i have situation in pl/sql have table called 'gender' has 2 columns gender1
, gender2
.
column gender1
supposed have males - value -m , gender2
supposed have female values -f.
ever reason there f values in column gender1
, there m values in column gender2
.
is there way in single update
statement have values moved respective correct columns?
i think update statement asking:
update gender set gender1 = (case when gender2 = 'm' 'm' else gender1 end), gender2 = (case when gender1 = 'f' 'f' else gender2 end) gender1 = 'f' or gender2 = 'm';
however, don't understand data structure trying represent.
Comments
Post a Comment