Extracting Time from Timestamp in SQL
问题 I am using Redshift and am looking to extract the time from the timestamp. Here is the timestamp: 2017-10-31 23:30:00 and I would just like to get the time as 23:30:00 Is that possible? 回答1: In Redshift you can simply cast the value to a time : the_timestamp_column::time alternatively you can use the standard cast() operator: cast(the_timestamp_column as time) 回答2: Please go through this link http://docs.aws.amazon.com/redshift/latest/dg/r_Dateparts_for_datetime_functions.html timezone,