title: How do I copy data between tables PostgreSQL
body: <p>I have two tables: account_company and document_invoice.
  Table account_company has 2 columns: company_id and company_name.
  Table document_invoice has the same columns: company_id and company_name.
  Something happened and delete all data from column company name from document_invoice.</p>
  
  <p>How can I write SQL query to copy data from account company table to document_invoice?
  I have been using UPDATE and SET but I don't know exactly how.</p>
  
  <pre><code>UPDATE document_invoice
     SET company_name = (SELECT company_name FROM account_company)
   WHERE document_id.company_name=document_id.account
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/gHQvn.png" alt="enter image description here"></p>