How can I connect two tables on columns with certain linked values but not having the same values?
For instance I need to join tbl1 to tbl2 where tbl1.col=100 and tbl2.col=200. The only connection that have is to me/my company.
Is there a way to link the rows without an explicit shared value? I need all rows with col value ‘100’ to be on the same row as all tbl2 columns have col value 200.
Yes. You can write a custom
JOINto relate data yourself.You didn’t specify your specific DBMS, so the following examples contain generic SQL.
Or, more dynamically: