Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Complex query, Union or OR

407173Oct 22 2003 — edited Oct 24 2003
Hi,

I have a complex SQL query with a big WHERE clause,

Select * from TableA , TableB, TableC
where cond1 and cond2 and cond3

now I have to add another condition Cond4, should I go ahead with

First approach
Select * from TableA , TableB, TableC
where (cond1 and cond2 and cond3) or (cond1 and cond2 and cond4)

Secodn Approach

Select * from TableA , TableB, TableC
where cond1 and cond2 and cond3
Union
Select * from TableA , TableB, TableC
where cond1 and cond2 and cond4


Union will be better or OR will be better
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2003
Added on Oct 22 2003
4 comments
430 views