एक ट्रांज़ैक्शन में एकसमान तारीख़ें
Idaho फील्ड ऑफिस फिर सक्रिय है और यह देखना चाहता है कि Minidoka काउंटी में टेस्ट साइट 13903, जिसे हम विश्लेषित कर रहे थे, और Ada काउंटी की साइट 11643 के बीच के आख़िरी 10 सैंपल्स की तुलना कैसी है.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Redshift परिचय
अभ्यास निर्देश
- ट्रांज़ैक्शन खोलिए.
- वही timestamp पाने के लिए सही फंक्शन का उपयोग कीजिए और दोनों SELECT स्टेटमेंट्स को ठीक से समाप्त कीजिए.
- ट्रांज़ैक्शन बंद कीजिए.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
--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
___