title: Updating an array in a SQL Table with filtered old vales
body: <p>Hi All I want to remove all non US numbers in the data base using an SQL Query but I tried tons of things but really did not worked out. Basically I already tried this query below:</p>
  
  <pre><code>UPDATE 
    accounts
  SET
    sms = array_remove(sms, SELECT
      FROM unnest(sms) pNumber 
      WHERE pNumber NOT LIKE '1%')
  </code></pre>
  
  <p>But it seems to having an error:</p>
  
  <p>My dream algorithm was:</p>
  
  <ol>
  <li>Update account's sms colomn by getting old sms value that does not start with '1'</li>
  <li>Remove them from the array then update each colomn after.</li>
  </ol>
  
  <p>I am using PostgreSQL BTW.</p>