ms access - Update specific values in more than one column - SQL -


i have table contains 2 columns, both have email values. want create query update specific data in both columns.

for example if have 2 records of email 'a@aa.aa' in 1 column , 3 records of 'a@aa.aa' in other column want them both updated.
here example want 'g@gg.ggg' 'a@aa.aa':

enter image description here

my question how query should like.

the simplest way run 2 update statements:

update table     set col1 = <newval>     col1 = <oldval>;  update table     set col2 = <newval>     col2 = <oldval>; 

this begs of question of why two columns storing same data. perhaps need review data structure , use junction table information.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -