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: ** SQL WHERE clause order

RE: ** SQL WHERE clause order

From: A Joshi <ajoshi977_at_yahoo.com>
Date: Wed, 05 Nov 2003 12:09:25 -0800

Thanks Raj and Naveen for your input. However my SQL has a union clause and I want it to be executed whether select_sen_emp_chk_first is Y/N. I tried the ORDER_PREDICATES hint suggested by Yong but do not know how to get it to work. Basically from the explain plan how can we tell when the variables are being checked. :  

SELECT emp_id FROM emp
WHERE :select_sen_emp_chk_first = 'Y'
AND dept = :dept
AND salary > :min_sal
UNION
SELECT emp_id FROM emp
WHERE :select_sen_emp_chk_first = 'N'
AND dept != :dept
AND salary < :min_sal Received on Wed Nov 05 2003 - 14:09:25 CST

Original text of this message

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