Table1

| ID | Code | Decision |
| --- | --- | --- |
| 1 | TK01 | Yes |
| 2 | OP01 | --- |
| 3 | TK01 | --- |
| 4 | MK02 | Yes |
| 5 | MK02 | --- |

HI Guys,
what SQL query would update **Decision** column if duplicate has been found in **Code** column.

other words :
ID 1 with **Code** TK01 has "Yes" so ID 3 should be updated with "Yes" value in **Decision** column.

Same as ID 5 as it matches Code with ID 4 and ID 4 has "Yes" value in column **Decision**.

I have created that in Access(code below) but how to do it in t-sql or mysql please

```
UPDATE Table1 t1 INNER JOIN Table1 t2
ON t1.Code = t2.Code
SET t1.Decision  = t2.Decision

```