(trunc(sysdate) - trunc(erh.arrival_dt)) >= 7 becomes
- trunc(erh.arrival_dt) >= 7 - trunc(sysdate) becomes by negating trunc(erh.arrival_dt) <= trunc(sysdate) - 7 becomes erh.arrival_dt <= trunc(sysdate) - 7 + 0.99999 hth connor --- [EMAIL PROTECTED] wrote: > > I think that the following statement is keeping this > application from using > an index in my cost-based execution plan. This is > an 8.0.4 database so I > don't have the option of creating a function-based > index. > > I'm not that great with SQL. Can anyone help me > rewrite this statement so > that I don't need to use the TRUNC function on this > column in blue? > > (trunc(sysdate) - trunc(erh.arrival_dt)) >= 7 AND > > Thanks, > > Cherie Machler > Oracle DBA > Gelco Information Network > > -- > Please see the official ORACLE-L FAQ: > http://www.orafaq.com > -- > Author: > INET: [EMAIL PROTECTED] > > Fat City Network Services -- (858) 538-5051 FAX: > (858) 538-5051 > San Diego, California -- Public Internet > access / Mailing Lists > -------------------------------------------------------------------- > To REMOVE yourself from this mailing list, send an > E-Mail message > to: [EMAIL PROTECTED] (note EXACT spelling of > 'ListGuru') and in > the message BODY, include a line containing: UNSUB > ORACLE-L > (or the name of mailing list you want to be removed > from). You may > also send the HELP command for other information > (like subscribing). ===== Connor McDonald http://www.oracledba.co.uk (mirrored at http://www.oradba.freeserve.co.uk) "Some days you're the pigeon, some days you're the statue" __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: =?iso-8859-1?q?Connor=20McDonald?= INET: [EMAIL PROTECTED] Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).