Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
danped
Contributor
Contributor

Custom business rule using compound join

Hi,
I have a business rule to implement which involves two tables (call them T1 and T2). I want to check some values for records which are related on two columns in the tables (Call them col1 and col2). So in SQL my rule is:

Select
T1.col1,T1.col2,T2.col1,T2.col2
from T1
inner join T2 on T1.col1 = T2.col1 and T1.col2 = T2.col2
where t1.col3 = t2.col3

The problem is I can only configure a single column join in the join condition. If I specify a new row i the join condition it treats this as a new instance of the table and if I specify the additional join in the where clause, the passing rows works correctly but the failing rows is wrong.
???
Thanks,
Dan
Labels (2)
1 Reply
Anonymous
Not applicable

Hi  
I have made a testing and got the SQL like this:
SELECT t1.* FROM `tbi`.`customer`  t1  JOIN  `tbi`.`customer2`  t2  ON (t1.`fname`=t2.`fname`) JOIN  `tbi`.`customer2`  t3  ON (t1.`lname`=t3.`lname`)  WHERE (t1.account_num = t2.account_num)
I have consulted to our developers and confirmed that it is impossible to have multiple join condition, we would like you to open a feature request on our bugtracker.
Thanks!
Shong