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

Truncate

Use trunc() to examine the distributions of attributes of the Fortune 500 companies.

Remember that trunc() truncates numbers by replacing lower place value digits with zeros:

trunc(value_to_truncate, places_to_truncate)

Negative values for places_to_truncate indicate digits to the left of the decimal to replace, while positive values indicate digits to the right of the decimal to keep.

Bu egzersiz

Exploratory Data Analysis in SQL

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

-- Truncate employees
SELECT ___(___, ___) AS employee_bin,
       -- Count number of companies with each truncated value
       ___
  FROM fortune500
 -- Use alias to group
 GROUP BY ___
 -- Use alias to order
 ORDER BY ___;
Kodu Düzenle ve Çalıştır