-
query giving different results
Hello,
While executing the following query the execution time is more since the to_date funtion used in where condition.
select admission_date from iptran where to_date(admission_date) between to_date('26-10-2002','dd-mm-yyyy').
But if
select admission_date from iptran where admission_date between to_date('26-10-2002','dd-mm-yyyy');
Results in no rows.
HOw should I re-write this query to retrieve in a minimum of time ?
Thanks in advance
Ravi
-
that cant be the whole query huh
plus admission_date is date or varchar2, seems varchar2 to me, if that was the case how can you compare varchar2 to date doh
-
implicit conversion from varchar2 -> date ?
If so, it's most likely another date format is used then 'dd-mm-yyyy', which gives you other results.
Always use explicit conversion.
HTH
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|