Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Need the Help in Information Object for DB2 Database
USHA
I am using Information Object to create a view for DB2 database tables.
Hi.. I have the requirement like
if tab1.col1='a' then join the tab1 and tab2 tables as
tab1.col2=tab2.col2
else if tab1.col1='b'
tab1.col3=tab2.col3
I am using Actuate Information Object(database is DB2) to create the view.
I am thinking the below one would work but i dont know this is correct or not
"FROM tab1 JOIN tab2 ON ((tab1.col1='a' AND tab1.col2=tab2.col2)
OR (tab1.col1='b' AND tab1.col3=tab2.col3))"
Is this code could fulfill my requirement... Provide the correct solution if i am wrong
Thanks in Advance
Usha
Find more posts tagged with
Comments
mwilliams
Hi Usha,<br />
<br />
<blockquote class='ipsBlockquote' ><p>
"FROM tab1 JOIN tab2 ON ((tab1.col1='a' AND tab1.col2=tab2.col2)<br />
OR (tab1.col1='b' AND tab1.col3=tab2.col3))"<br /></p></blockquote>
<br />
This should join tab1 and tab2 anywhere that both conditions in either set of parentheses is true (i.e. anywhere tab1.col1 = 'a' and col2 is the same in both tables or anywhere tab1.col1 = 'b' and col3 is the same in both tables). If this is what you're looking for, then what you have should work for you.<br />
<br />
Hope this helps.