"OR" in a join

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
jherr22
Premium Member
Premium Member
Posts: 56
Joined: Mon Jan 29, 2007 3:24 pm
Location: Denver
Contact:

"OR" in a join

Post by jherr22 »

Is there a way to incorporate an "OR" condition within a JOIN stage (or lookup)?
ddevdutt
Participant
Posts: 47
Joined: Wed Aug 22, 2007 2:38 pm

Re: "OR" in a join

Post by ddevdutt »

Can you please explain a bit more elaborately as to what your requirement is?
DD

Success is right around the corner
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Even so, the answer is no in a Join stage. In a Lookup stage you have the possibility of a range lookup but that's a highly specific case of "OR". As noted, please be more specific.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jherr22
Premium Member
Premium Member
Posts: 56
Joined: Mon Jan 29, 2007 3:24 pm
Location: Denver
Contact:

Post by jherr22 »

I would like to replicate the following:

select x.a, y.b
from x, y
where x.m = y.m
or x.n = y.n
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

What is the source ?

What is the data volume ?
ddevdutt
Participant
Posts: 47
Joined: Wed Aug 22, 2007 2:38 pm

Post by ddevdutt »

Okay.

One of the ways you can achieve this is to do a lookup first (this will depend on your data volumes)
Then send the rejects from the first lookup to a second lookup stage where you use the same reference dataset.
You can then Funnel the outputs from both the lookup and proceed with any other transformations that you may have.

The first lookup will cater to your first constraint and the second lookup will cater to the second constraint in your "OR" statement.

Let me know if this works.
jherr22 wrote:I would like to replicate the following:

select x.a, y.b
from x, y
where x.m = y.m
or x.n = y.n
DD

Success is right around the corner
jherr22
Premium Member
Premium Member
Posts: 56
Joined: Mon Jan 29, 2007 3:24 pm
Location: Denver
Contact:

Post by jherr22 »

ddevdutt:

Perfect - that's the ticket!
I appreciate your help!
ddevdutt
Participant
Posts: 47
Joined: Wed Aug 22, 2007 2:38 pm

Post by ddevdutt »

Glad to be of help :D
DD

Success is right around the corner
Post Reply