April 2026
Beginner
493 pages
23h 2m
English
The topic of temporal functions covers date manipulations. In this section, we’ll inspect commonly used functions in this category.
As you would naturally expect, you can execute date calculations in DQL, where you add or subtract values to or from base dates. Listing 7.135 contains an example in which we add three days to req_dlv_date by using the INTERVAL keyword. Note that INTERVAL is followed by a natural language input, and PostgreSQL is able to handle that.
SELECT id, req_dlv_date, req_dlv_date + INTERVAL '3 days' AS dlv_date_deadlineFROM customer_orderWHERE req_dlv_date IS NOT NULL;
Listing 7.135 Adding Three Days to Base Date
The results set can be seen in Table 7.124, which ...
Read now
Unlock full access