title: Redshift: Get hour from Time (HH:MM:SS) column
body: <p>I have a time column with values in HH:MM:SS format. How do I get only the hour from that column?</p>
  
  <p>I have tried using extract(hour) function.</p>
  
  <pre><code>select extract(hour from opentime::datetime)
  from transaction
  </code></pre>
  
  <p>I got an error saying Amazon Invalid operation: Timestamp out of range. I assume this is because the opentime column isn't exactly DateTime but only time. </p>
  
  <p>I need to get only the hour.</p>
  
  <pre><code>column value --&gt; 09:00:00
  expected output --&gt; 09
  </code></pre>