Re: SQL, forcing a sequential evaluation among clauses of a lilter
From: kresimir <kresimir_at_ozemail.com.au>
Date: Wed, 13 May 1998 22:15:23 +1000
Message-ID: <35598EDA.C02451D_at_ozemail.com.au>
email;internet: kresimir_at_ozemail.com.au x-mozilla-cpt: ;0
x-mozilla-html: FALSE
Date: Wed, 13 May 1998 22:15:23 +1000
Message-ID: <35598EDA.C02451D_at_ozemail.com.au>
Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit
Emmanuel
Of the top of my head (without knowing the structure and datatypes of your data) I would suggest that you try following querry.
SELECT SUM(amount)
FROM PIECES
WHERE ...
TYPE IN ('TYPE1','TYPE2','TYPE3') AND
[Quoted] [Quoted] properties >= to_char(Min_batch_number) AND
properties <= to_char(Max_batch_number);
This will work if you can be sure that your 'properties' are allways numeric and data type varchar2. Also, this one will use index o properties (if there is one).
Kind regards
Kresimir Fabijanic
--------------6E330F29424A57DF33CBB77F
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Kresimir Fabijanic Content-Disposition: attachment; filename="vcard.vcf" begin: vcard fn: Kresimir Fabijanic n: Fabijanic;Kresimir
email;internet: kresimir_at_ozemail.com.au x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1 end: vcard
--------------6E330F29424A57DF33CBB77F--
Received on Wed May 13 1998 - 14:15:23 CEST