Subject RE: [firebird-support] Re: Possible to write this in a way that indices will be used
Author Rick Debay
> if D.SuplCde is 'ABC' and ISupplierCode is NULL, result will be
TRUE??

Wrong. Since one has a value and the other is NULL, they are DISTINCT.
The NOT would flip that to false.

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Maya Opperman
Sent: Thursday, May 15, 2008 11:28 AM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Re: Possible to write this in a way that
indices will be used

>Doru wrote:>
>If you are using Firebird 2+ Testing DISTINCTness will be a nice way to

>go :
>http://www.firebirdsql.org/manual/nullguide-langelem.html

OK, so ((D.SuplCde = :ISupplierCode) or (:ISupplierCode is null))

would change to ((D.SuplCde is not distinct from :ISupplierCode))

to achieve the same results?

Ie. if D.SuplCde is 'ABC' and ISupplierCode is 'ABC', result will be
TRUE.
if D.SuplCde is 'ABC' and ISupplierCode is NULL, result will be
TRUE??
if D.SuplCde is 'ABC' and ISupplierCode is 'XYZ', result will be
FALSE.

Is that right?

Thanks
Maya

Disclaimer: This message (including attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. RxStrategies, Inc. shall not be liable for the improper or incomplete transmission of the information contained in this communication or for any delay in its receipt or damage to your system. RxStrategies, Inc. does not guarantee that the integrity of this communication has been maintained nor that this communication is free from viruses, interceptions or interference.