Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Index on Year of date field

Re: Index on Year of date field

From: Konstantin Kivi <konst_at_sirena.rinet.ru>
Date: 1998/03/04
Message-ID: <EpAEH9.2nK.0.debian@sirena.rinet.ru>#1/1

Stephan Schaefer <stephan.schaefer_at_camline.com> wrote:
> I have a table with an index on the date field.
> And I have a view created by:
> create view myview
> as select col1,to_char(date_col,'YYYY') year
> from mytable ;

> Can I create an index on the date field so that selecting
> by year that index is used?
 

> Stephan Schaefer
> stesch_at_camline.com

I am afraid you will have to select between efficiency and convenience. Don't use view, put to_char in every query and say ' date_col between ...1997... and ...1998....

Konstantin Received on Wed Mar 04 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US