Extracting time units with SUBSTRING()
In a previous exercise, you separated the interval between the violation_time and to_hours_in_effect columns into their constituent hour and minute time units. Some pre-cleaning of these values was done behind the scenes to make the values more amenable for conversion because of inconsistencies in the recording of these values. The functions explored in this lesson provide an approach to extract values from strings.
In this exercise, you will use SUBSTRING() to extract the hour and minute units from time strings. This is an alternative approach to extracting time units removing the need to convert the string to a TIMESTAMP value to extract the time unit as was done previously.
この演習はコースの一部です
Cleaning Data in PostgreSQL Databases
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
SELECT
-- Define hour column
___(___ ___ ___ ___ ___) AS ___
FROM
parking_violation;