CRITICAL SKILL 2.7

Use Dates and Data Functions (Formatting and Chronological)

Date is the next commonest type of data you’ll find in an Oracle database after character and numeric data. The date data type consists of two principal elements: date and time. It’s important to keep in mind that the date data type includes time when comparing two dates with each other for equality.

The default date format in many Oracle databases is DD-MON-YY, where DD represents the day, MON is the month and YY is the two-digit year. A date can be inserted into a table without specifying either the four-digit year or a value for the time element. Oracle will default the century to ‘20’ for years ‘00-49’ and ‘19’ for years ‘50-99’. Without a specific time being specified ...

Get Oracle Database 10g: A Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.