July 2010
Intermediate to advanced
840 pages
16h 33m
English
Almost every SQL implementation has a DATE data type, but the functions available for them vary quite a bit. The most common ones are a constructor that builds a date from integers or strings; extractors to pull out the month, day, or year; and some display options to format output.
You can assume that your SQL implementation has simple date arithmetic functions, although with different syntax from product to product, such as:
| 1. | A date plus or minus a number of days yields a new date. |
| 2. | A date minus a second date yields an integer number of days. |
Table 4.1 displays the valid combinations of <datetime> and <interval> data types in Standard SQL:
Read now
Unlock full access