title: How can I use a select query in SQL to find a list of email addresses that only contain 6 random numbers?
body: <p>I’m currently looking for a way to use a SQL query in order to find a list of all email addresses in our DB has only 6 random numbers and then ‘@gmail.com’. </p>
  
  <p>Example: </p>
  
  <pre><code>email
  
  ----------
  
  123456@gmail.com
  324522@gmail.com
  </code></pre>
  
  <p>Here is what I tried: </p>
  
  <pre><code>select email 
  from customers
  where email Not like '%^[0-9]%'
  </code></pre>
  
  <p>When I run this, all emails appear even the ones without any numbers in them. </p>
  
  <pre><code>select email,
  SPLIT_PART(email, '@',1) as username, 
  SPLIT_PART(email, '@',2) as domain,
  (case when username not like '%^[0-9]%' then 'Incorrect' else 'Correct' End) as format
  from customers
  where domain = 'gmail.com'
  and format = 'Correct' 
  </code></pre>
  
  <p>I tried this as well, for all emails even if they had numbers in them they appeared as Incorrect.</p>
  
  <p>It seems like the numbers in the columns are not being recognized and I'm not sure how to fix that. The column format is Varchar</p>