title: How can I extract string 'foo' from a string foo@mail.com?
body: <pre><code>select left(emailaddress, len(emailaddress) - charindex('@', emailaddress))
  </code></pre>
  
  <p>I am getting the result below:</p>
  
  <pre><code>foo@ma
  </code></pre>
  
  <p>Please correct the select statement below.  I need to do this with tones of email addresses and extract the username ONLY.</p>