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

Consistent dates in a transaction

The Idaho field office is back at it again, and wants to see how the last 10 samples between the test site 13903 in Minidoka county that we have been analyzing and site 11643 in Ada count compare.

Bu egzersiz

Introduction to Redshift

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

Egzersiz talimatları

  • Open the transaction.
  • Use the proper function to get the same timestamp and correctly terminate both select statements
  • Close the transaction

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

--Open the Transaction
___

SELECT *, CAST(sample_date AS DATE) as date_sampled
  FROM public_intro_redshift.idaho_samples
 WHERE fk_monitoringlocation = 13903 
        -- Use the consistent timestamp function
       AND CAST(sample_date AS DATE) < ___
ORDER BY date_sampled DESC
 -- Add the statement terminator
LIMIT 10___

SELECT *, CAST(sample_date AS DATE) as date_sampled
  FROM public_intro_redshift.idaho_samples
 WHERE fk_monitoringlocation = 11643 
        -- Use the consistent timestamp function
       AND CAST(sample_date AS DATE) < ___
ORDER BY date_sampled DESC
 -- Add the statement terminator
LIMIT 10___

-- Close the transaction       
___
Kodu Düzenle ve Çalıştır