For the given schema:
create table foo (a int not null, b int not null, primary key (a, b));
create table bar (a int, b int, c int, foreign key foo_fk (a, b) references foo (a, b));
I want to join a
and b
, where there may be any number of b
s for each a
.
I can only come up with three solutions: