Re: Just as a learning exercise

From: Jared Still <jkstill_at_gmail.com>
Date: Wed, 4 May 2011 16:28:30 -0700
Message-ID: <BANLkTimCE+tHX-M944aJTyn64BUTA0D+YQ_at_mail.gmail.com>



On Wed, May 4, 2011 at 6:10 AM, Thomas Day <tomdaytwo_at_gmail.com> wrote:

>
> select p.last_name, p.first_name,s.title, t.created as completed
> from persons p
> join required_courses s on 1=1
> left join training_survey t on s.ap_code = t.survey_app and t.user_id =
> p.id
> and trunc(t.created) >= to_date('10/01/2009', 'MM/DD/YYYY')
> and trunc(t.created) <= to_date('09/30/2010', 'MM/DD/YYYY')
>

This bit is I realize not what you asked for, but it valuable enough I thought it worth pointing out.

Converting the date portion to this makes is possible to use an index where one could not be used before. (should the index be of benefit)

   t.created between to_date('10/01/2009', 'MM/DD/YYYY') and to_date('09/30/2010', 'MM/DD/YYYY')

Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist Oracle Blog: http://jkstill.blogspot.com Home Page: http://jaredstill.com

--
http://www.freelists.org/webpage/oracle-l
Received on Wed May 04 2011 - 18:28:30 CDT

Original text of this message