Compound Foreign Keys


#1

Currently the “Foreign key” field type allows to choose only 1 field for join condition.

However, there are cases when more than one join condition is needed to join two tables, e.g.:
select * from table1 as t1 join table2 as t2 on t2.field1 = t1.field1 and t2.field2 = t2.field2

This would be really useful.


#2

Hi @dtroyan
I’m not sure if I understand correctly, but it sounds like you want to be able to do this:
https://github.com/metabase/metabase/issues/7335 - if yes, then upvote by clicking the :+1:


#3

thank you, that’s definitely it. Although it’s quite sad to see only 5 votes on this issue:(


#4

@dtroyan
It’s not a common issue I guess, but one of the upvotes is me :slight_smile: a few minutes ago
Remember to click the Subscribe-button, so you get notifications, when there’s activity.
And if you feel like you have use-cases, which are not already mentioned, then please feel free to write a comment (but please be descriptive, so the developers can benefit from it)