My table1 looks like:
 
I need to increment
id name_co name_r temp sld 1 name1 1 ... ... 2 name2 1 ... ... 3 name2 1 ... ... 4 name2 1 ... ... 5 name3 1 ... ... 6 name2 1 ... ...
name_r if there are two or more identical name_co.
To be so:
id name_co name_r temp sld 1 name1 1 ... ... 2 name2 1 ... ... 3 name2 2 ... ... 4 name2 3 ... ... 5 name3 1 ... ... 6 name2 4 ... ...
I tried different options and I came to this:
    UPDATE table1 
        SET name_r = name_r + 1 
        WHERE (SELECT COUNT(*) 
        GROUP BY name_co 
        HAVING name_co > 1)
The query works and returns 0 rows, but I know that in some way he's wrong, but I can't figure out what. Can anyone help? (And a bit of explanation, so I better understood)
 
    