Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Date format in where clause

192024Dec 18 2002 — edited Dec 19 2002
Hi,
I have a question. Our team was tuning a query where we needed to select a date column based solely on the month. We used between and it was very costly. Then we tried date_column_name = to_date('NOV-2002','MMM-YYYY') That sped it up considerably and it's returning the right rows. I just don't understand because I wouldn't have thought it would have met the = to criteria. I mean 11-20-2002 is not = to 'Nov-2002'. Does SQL automatically format the date column to match the format it is being compared to. I need to document this so if you can point me to documentation on it; I would greatly appreciate it.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 16 2003
Added on Dec 18 2002
11 comments
26,373 views