create table foo (id, name)
create table foo_config (id, foo_id, key, value)
insert into foo (1, 'name1')
insert into foo (2, 'name2')
insert into foo (3, 'name3')
insert into foo_config (1, 1, 'key1', 'val1')
insert into foo_config (2, 1, 'key2', 'val2')
insert into foo_config (3, 1, 'key3', 'val3')
insert into foo_config (4, 2, 'key1', 'val1')
insert into foo_config (5, 3, 'key2', 'val2')
How do I query for all foo's whose key1 = 'val1'
, in our case foo:1
and foo:2 will be listed here. How should I model / query for this,
appreciate any pointers for the same.