Hi All,
I need to join 2 tables based on one key coloumn.
I need to populate a value for a perticular coloumn based on matched records i.e one type of value for matched records
and different value for unmatched records.
ex:If the records in two tables satisfy the join condition then
for matched records
location
usa
Else,
for unmatched record
location
uk
Could you please help out on this
Thanks in advance,
Regarding Join Condition
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
Hi Diya,
You can achieve this by loading one of tables into hashed file as a reference table.
Now, use one native DB stage or ODBC stage for one table, a transformer, a hashed file (as said above, which contains data from the other table) and one target stage (can be a seq. or hashed file, depends on your needs).
Check if the key exists (FOUND) in the hashed file. If not then populate your column with UK else populate with US.
Hope that helps.
Thanks,
Naveen.
You can achieve this by loading one of tables into hashed file as a reference table.
Now, use one native DB stage or ODBC stage for one table, a transformer, a hashed file (as said above, which contains data from the other table) and one target stage (can be a seq. or hashed file, depends on your needs).
Check if the key exists (FOUND) in the hashed file. If not then populate your column with UK else populate with US.
Hope that helps.
Thanks,
Naveen.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
It depends on your tables..
Out of two tables can we say that one will have all the records for that key ? Or Keys are divided among two tables ?
If its the first case, then you can use Inner Join or Even lookup stage, but if its the second scenario than you will have to do left or Right outer join.
IHTH..
Out of two tables can we say that one will have all the records for that key ? Or Keys are divided among two tables ?
If its the first case, then you can use Inner Join or Even lookup stage, but if its the second scenario than you will have to do left or Right outer join.
IHTH..