Thanks for your idea. I tried, and the format like the following.
SQL> select trunc(to_date('16-DEC-02','dd-mon-yyyy')) from dual;
TRUNC(TO_DATE('16-DE
--------------------
16-DEC-0002 00:00:00
SQL> select trunc(to_date('16-DEC-02','dd-mon-yyyy'), 'yyyy') from dual;
TRUNC(TO_DATE('16-DE
--------------------
01-JAN-0002 00:00:00
SQL> select trunc(to_date('16-DEC-02','dd-mon-yyyy'), 'mon') from dual;
TRUNC(TO_DATE('16-DE
--------------------
01-DEC-0002 00:00:00
SQL> select trunc(to_date('16-DEC-02','dd-mon-yyyy'), 'dd') from dual;
TRUNC(TO_DATE('16-DE
--------------------
16-DEC-0002 00:00:00
Another question:
If a table contains a large number of records, use which one will be executed faster,where ... in ,where exists,and why?
|