I have Two tables :
Table1, Table2
I have to write a SQL query which has inner join on three columns based on <> 0 condition on these tables. My condition is
if(table1.ID != 0), then inner join on table1.ID = table2.ID else,
if(table1.MemberID != 0), then inner join on table1.MemberID = table2.MemberID else,
inner join on table1.PersonID = table2.PersonID