title: How to check if value from one column has multiple values from another column and based on the result how to update\remove data correctly?
body: <p>I have such table <code>partner_stockrecord</code>:</p>
  
  <pre><code>"id"|"partner_sku"|"partner_id"
  1      sku1          1
  2      sku1          2
  
  3      sku2          1
  4      sku2          2
  5      sku2          3
  
  6      sku3          1
  </code></pre>
  
  <p>I need to have the next query logic:</p>
  
  <ol>
  <li>if the same <code>partner_sku</code> has both <code>partner_id = 2</code> and <code>partner_id = 3</code> -> remove row with <code>partner_id = 2</code> (in order to keep just <code>partner_id = 3</code> in DB), i.e <code>sku2</code> has both <code>partner_id</code> = <code>2</code> and <code>3</code>, how to remove the row where <code>id = 4</code> in this case.</li>
  <li>if <code>partner_sku</code> has just <code>partner_id = 2</code>, set <code>partner_id = 3</code>, i.e. <code>sku</code> has <code>partner_id</code> = <code>2</code> and does not have <code>3</code>.</li>
  </ol>
  
  <p>I know, how to update\set the value with condition:</p>
  
  <pre><code>UPDATE partner_stockrecord
  SET partner_id = 3
  WHERE partner_id = 2;
  </code></pre>
  
  <p>but I do not know, how to write a complex query which can check different <code>partner_id</code> for the same <code>partner_sku</code>.</p>