In PostGreSQL, I have a table like this:
id | id_tab1 | id_tab2 1 | 1 | 2 2 | 1 | 3 3 | 1 | 4 4 | 2 | 3 5 | 3 | 5