My SQL is a bit rusty and I'm trying to clean up some data.

What i need is to do is UPDATE some of the records in a table where
the COUNT for [field1] = 2.

My initial select query gives me the set to look through, but now what?
I need to change some [tbl_item].itemvalue in this set, where itemvalue = 'baddata' make it 'gooddata'


select itemcode,count(itemcode) from tbl_item
group by itemcode
having count(itemcode)=2


in other words, there are some records where itemvalue='baddata' and we do not want to change them, unless that itemcode is in the table exactly twice.