Instruction
Perfect! That's it for this part of the course. Let's have a short summary before we continue.
- To find rows for three months starting from March 20, 2017, use:
SELECT ... FROM ... WHERE column_name >= '2017-03-20' AND column_name < CAST('2017-03-20' AS DATE) + INTERVAL '3' month - To find rows for the current month, use:
SELECT ... FROM ... WHERE column_name >= CAST(EXTRACT(year FROM CURRENT_TIMESTAMP) || '-' || EXTRACT(month FROM CURRENT_TIMESTAMP) || '-01' AS DATE)
or use your database's built-in function if there is one:SELECT ... FROM ... WHERE column_name >= DATE_TRUNC('month', CURRENT_TIMESTAMP)
Okay, let's do a very short quiz before we conclude this part.
Exercise
Click to continue.



