TO_DATE() function Example in oracle 11g
SELECT last_name, hire_date FROM employees WHERE hire_date = TO_DATE('May 24, 1999', 'fxMonth DD, YYYY');
Here employees table contains columns as last_name and hire_date. We have implemented TO_DATE() function on hire_date column.
SELECT last_name, TO_CHAR(hire_date, 'DD-Mon-yyyy') FROM employees WHERE TO_DATE(hire_date, 'DD-Mon-yy') < '01-Jan-1990';
Here employees table contains columns as last_name and hire_date. We have implemented TO_DATE() function on hire_date column.
SELECT last_name, TO_CHAR(hire_date, 'DD-Mon-YYYY') FROM employees WHERE hire_date < TO_DATE('01-Jan-90','DD-Mon-RR');
Here employees table contains columns as last_name and hire_date. We have implemented TO_DATE() function on hire_date column.