I have a table AreaUser like below.
area user
------------
area2 user1
area2 user2
area3 user1
(area,user) is a pk
I execute a query like below
update areatable
set user = 'user2'
where user = 'user1'
Primary key constraint error thrown for the first row update and the third row is not updated. How do i ignore the first row error and keep going with the updating the third row
or
how can i find if the (area,user) combination is already there in table just before updating that row.
Hope i stated the question clearly with this example. Thanks in advance for the help.
You need a
NOT EXISTS, E.g.