mysql - update all rows at once with different where condition my sql -
i have table name details in there 2 columns. first 1 name , second gender. table consist around 50 entries of names , gender male/female. trying update gender column contains male , female both according person gender. want change data gender = male female , female male
here's query i've tried:
update details set gender = 'm', gender='f' gender = 'm';
if need in 1 statement, try using case
statement instead:
update details set gender = case when gender = 'm' 'f' else 'm' end gender in ('m', 'f')
Comments
Post a Comment