title: Update post_meta value based on 2 keys - Wordpress
body: <p>I have 5000+ products in WooCommerce and I'm looking for a SQL query to set their barcodes based on their SKU. Both "barcode" and "sku" are custom posts meta. Basically, something like:</p>
  
  <pre><code>UPDATE wp_postmeta SET barcode='x' WHERE sku='y';
  </code></pre>
  
  <p>But it doesn't work because barcode and sku are not real table columns. So, can anyone provide a working query? I'm new to SQL. Thank you!</p>