title: SQL Server's isNumeric() equivalent in amazon redshift
body: <ul>
  <li>I'm using amazon redshift as my data warehouse</li>
  <li>I have a field (field1)of type string.  Some of the strings start with four numbers and others with letters:</li>
  </ul>
  
  <p>'test alpha'<br>
  '1382 test beta'</p>
  
  <ul>
  <li>I want to filter out rows where the string does not start with four numbers</li>
  <li>Looking at the redshift documentation, I don't believe isnumber or isnumeric are functions.  It seems that the 'like' function is the best possibility.  </li>
  <li><p>I tried</p>
  
  <p>where left(field1, 4) like '[0-9][0-9][0-9][0-9]'</p></li>
  </ul>
  
  <p>this did not work and from the link below seems like redshift may not support that:</p>
  
  <p><a href="https://forums.aws.amazon.com/message.jspa?messageID=439850" rel="noreferrer">https://forums.aws.amazon.com/message.jspa?messageID=439850</a></p>
  
  <p>is there an error in the 'where' clause?  if not and that clause isn't supported in redshift, is there a way to filter?  I was thinking of using cast </p>
  
  <pre><code>cast(left(field1,4) as integer) 
  </code></pre>
  
  <p>and then passing over the row if it generated an error, but not sure how to do this in amazon redshift.  or is there some other proxy for the isnumeric filter.</p>
  
  <p>thanks</p>