Difference between revisions of "DATES"
Jump to navigation
Jump to search
(Created page with "==Rules for Dates== Sometimes you need to use a date as a search condition. Oracle 11g displays dates in the default format DD-MON-YY, with MON being the standard three-letter...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 9: | Line 9: | ||
FROM books | FROM books | ||
WHERE pubdate = '21-JAN-05' | WHERE pubdate = '21-JAN-05' | ||
SELECT order#, orderdate | |||
FROM orders | |||
WHERE orderdate < '01-APR-09' | |||
TO_DATE('November 3, 2001', 'Month dd yyyy') - > 03-Nov-2001 | |||
[[#Rules for Dates|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]] | [[#Rules for Dates|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]] |
Latest revision as of 18:59, 19 November 2017
Rules for Dates
Sometimes you need to use a date as a search condition. Oracle 11g displays dates in the default format DD-MON-YY, with MON being the standard three-letter abbreviation for the month. Because the Pubdate field contains letters and hyphens, it’s not considered a numeric value when Oracle 11g performs searches. Therefore, a date value must be enclosed in single quotation marks
SELECT * FROM books WHERE pubdate = '21-JAN-05'
SELECT order#, orderdate FROM orders WHERE orderdate < '01-APR-09'
TO_DATE('November 3, 2001', 'Month dd yyyy') - > 03-Nov-2001