BaşlayınÜcretsiz başlayın

Extracting house numbers from a string

Addresses for the Queens borough of New York City are unique in that they often include dashes in the house number component of the street address. For example, for the address 86-16 60 Ave, the house number is 16, and 86 refers to the closest cross street. Therefore, if we want the house_number to strictly represent the house number where a parking violation occurred, we need to extract the digits after the dash (-) to represent this value.

In this exercise, you will use STRPOS(), SUBSTRING(), and LENGTH() to extract the specific house number from Queens street addresses.

Bu egzersiz, kursun bir parçasıdır

Cleaning Data in PostgreSQL Databases

Kursa Göz Atın

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

SELECT
  -- Find the position of first '-'
  ___(___, ___) AS dash_position
FROM
  parking_violation;
Kodu Düzenle ve Çalıştır