title: SQL Update Query with select statement
body: <p>I have a table with email addresses. I am trying to fill a <code>DomainName</code> column with the domains from the email addresses. The select statement works fine on its own. But when I add it to the update query I get the following:</p>
  
  <blockquote>
    <p>Subquery returned more than 1 value. This is not permitted when the subquery follows <code>=</code>, <code>!=</code>, <code>&lt;</code>, <code>&lt;=</code>, <code>&gt;</code>, <code>&gt;=</code> or when the subquery is used as an expression.</p>
  </blockquote>
  
  <p>What should I be using in place of the <code>=</code>?</p>
  
  <pre><code>update Table1 set Table1.DomainName=
  (select SUBSTRING(Table1.Email,(CHARINDEX('@',Table1.Email)+1),LEN(Table1.Email) - 
  (CHARINDEX('@',Table1.Email))) as DomainName FROM Table1)
  </code></pre>