Handling values with the DATE datatype in SQL presents several challenges. In Oracle and many other database systems, this is primarily because a date is neither a string value nor a numeric value. Yet, using the proper functions, we can transform values of the DATE datatype into string values and even do date arithmetic. To see how this works, let's begin by returning to the subject of SYSDATE
that we mentioned in Chapter 2, SQL SELECT Statments.
As we mentioned in Chapter 2, SQL SELECT Statments,
SYSDATE
is an Oracle pseudo-column—it does not represent an actual column value, but rather returns a system value generated by Oracle. In the case of SYSDATE
, it returns the current date and, if we instruct it to do so, the time as well. Let's look at an example using SYSDATE
, as shown in the following example:
If you run the command listed previously, your results will differ. That's because SYSDATE
returns the current date when...