Gossamer Forum
Home : General : Databases and SQL :

Logical Operation

Quote Reply
Logical Operation
Hi

I have a basic query


Select tab1.col1, tab2.col2, tab3.col3 from tab1, tab2, tab3 WHERE

tab1.col3 = tab2.col4 AND tab1.col4 = tab3.col2 AND

(tab1.col5='test1' OR tab2.col5='test2' OR tab3.col4='123')




I need to restructure this query to remove the OR conditions. This is actually a representation of a larger query which needs to be tweaked to improve performance. I tried using 'UNION'/'UNION ALL' but it does not return me the same result set. Probably I am structuring it wrong. Could someone help me out in restructuring this SQL without OR condition in the predicates?

Regards

Rajeev

Last edited by:

rajeev: Sep 23, 2002, 12:30 PM
Quote Reply
Re: [rajeev] Logical Operation In reply to
1) What database application are you using?
2) Would you please post the larger query and also explain what kind of record set you hope to achieve (not in SQL, but in plain english of what you hope to accomplish with the query)?
========================================
Buh Bye!

Cheers,
Me