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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: select with Null

Re: select with Null

From: Igor Neyman <ineyman_at_perceptron.com>
Date: Wed, 22 Nov 2000 14:14:39 -0500
Message-Id: <10688.122750@fatcity.com>


With this solution you need function-based indexes on company_code and operator_code in order for indexes to be used.

Igor Neyman, OCP DBA
Perceptron, Inc.
(734)414-4627
ineyman_at_perceptron.com

>
>
>
> select d.discount_type
> from discount d
> where (NVL(d.company_code,'XX') = 'XX')
> and (NVL(d.operator_code,'YY') = 'YY')
>
>
>
>
>
>
>
>
> Raj Gopalan <raj.gopalan_at_netdecisions.co.uk> on 22/11/2000 12:35:24 PM
>
> Please respond to ORACLE-L_at_fatcity.com
>
>
>
>
>
>
>
>
> To: Multiple recipients of list ORACLE-L
> <ORACLE-L_at_fatcity.com>
>
> cc: (bcc: Marcos Vera/M&S Consultores/51)
>
>
>
> Subject: select with Null
>
>
>
>
>
>
>
>
> Hello list,
>
> I have a query
>
> select d.discount_type
> from discount d
> where (d.company_code = 'XX' or
> d.company_code is null)
> and (d.operator_code = 'YY' or
> d.operator_code is null)
>
> Apparently, oracle is not using the index since I am using IS NULL. But
the
> functional requirement is such that the query need to consider records
even
> if company_code, Operator_code ,... is null.
>
> Any thoughts on how do I modify this query so that the index is being
used.
>
> TIA
>
> Raj
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Raj Gopalan
> INET: raj.gopalan_at_netdecisions.co.uk
>
> 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: ListGuru_at_fatcity.com (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).
>
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author:
> INET: Marcos.Vera_at_msconsultores.com.pe
>
> 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: ListGuru_at_fatcity.com (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
Received on Wed Nov 22 2000 - 13:14:39 CST

Original text of this message

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