title: Update duplicate records where a specific column has different values
body: <p>The article below helped me to retrieve duplicate records which have different values in a specific column:</p>
  <p><a href="https://stackoverflow.com/questions/73303683/get-records-where-one-column-has-the-same-values-and-another-column-has-differen/73303854#73303854">Get records where one column has the same values and another column has different values</a></p>
  <p>Now I would like to update a column of these duplicates:</p>
  <pre><code>Name Type  NameType
  XX01 Box   XX01Box
  XX01 Table XX01Table
  </code></pre>
  <p>From the sample table above, I would like to update the column NameType with the column Name and Type for duplicate records where the Name is the same but Type is different. Below is the query I used:</p>
  <pre><code>UPDATE table
  SET NameType = Name + Type 
  FROM table where name in (select t.Name,t.Type,t.NameType
  from table t
  where exists (select 1
                from table t2
                where t2.Name = t.Name and t2.Type &lt;&gt; t.Type));
  </code></pre>
  <p>I get the below error when I run the above query:</p>
  <p>Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.</p>
  <p>Any idea what is wrong with my query?</p>